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 / TermMigrator.php

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

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