PluginProbe
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses / 2.10.01
FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses v2.10.01
2.10.0 2.10.01 2.9.1 2.9.0 2.8.1 2.8.0 2.7.7 2.7.5 2.7.0 2.6.01 2.6.0 2.5.0 2.4.01 trunk 1.0.90 1.0.91 1.0.92 1.0.93 1.0.94 1.0.95 1.0.96 1.0.97 1.0.98 1.0.99 1.1.0 All 77 releases
fluent-community / database / Migrations / NotificationsMigrator.php

NotificationsMigrator.php in FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS & Online Courses 2.10.01, at database/Migrations/NotificationsMigrator.php

42 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // phpcs:disable
3 namespace FluentCommunity\Database\Migrations;
4
5 class NotificationsMigrator
6 {
7 /**
8 * Migrate the table.
9 *
10 * @return void
11 */
12 public static function migrate()
13 {
14 global $wpdb;
15
16 $charsetCollate = $wpdb->get_charset_collate();
17
18 $table = $wpdb->prefix . 'fcom_notifications';
19 $indexPrefix = $wpdb->prefix . 'fcom_nt_';
20
21 if ($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) {
22 $sql = "CREATE TABLE $table (
23 `id` BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
24 `feed_id` BIGINT UNSIGNED NULL,
25 `object_id` BIGINT UNSIGNED NULL,
26 `src_user_id` BIGINT UNSIGNED NULL,
27 `src_object_type` VARCHAR(100) NULL,
28 `action` VARCHAR(100) NULL,
29 `title` VARCHAR(192) NULL,
30 `content` TEXT NULL,
31 `route` TEXT NULL,
32 `created_at` TIMESTAMP NULL,
33 `updated_at` TIMESTAMP NULL,
34 INDEX `{$indexPrefix}_mt_idx` (`feed_id`),
35 INDEX `{$indexPrefix}_mto_id_idx` (`object_id`),
36 INDEX `{$indexPrefix}_mto_id_key` (`action` )
37 ) $charsetCollate;";
38 dbDelta($sql);
39 }
40 }
41 }
42