# fluent-community/2.6.0/database/Migrations/TermFeedMigrator.php

FluentCommunity – Ultra-Fast High-Performance Social Network, Community, LMS &amp; Online Courses, version 2.6.0. 35 lines.

- Page: https://pluginprobe.com/plugins/fluent-community/2.6.0/code/database/Migrations/TermFeedMigrator.php
- Raw: https://pluginprobe.com/plugins/fluent-community/2.6.0/raw/database/Migrations/TermFeedMigrator.php
- Modified: 2024-11-07T12:38:44+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-community/2.6.0/code/database/Migrations/TermFeedMigrator.php#L10-L20`.

```php
<?php
// phpcs:disable

namespace FluentCommunity\Database\Migrations;

class TermFeedMigrator
{
    /**
     * @param bool $isForced
     * @return void
     */
    public static function migrate($isForced = false)
    {
        global $wpdb;

        $charsetCollate = $wpdb->get_charset_collate();
        $table = $wpdb->prefix . 'fcom_term_feed';

        $indexPrefix = $wpdb->prefix . 'fcom_tf_';

        if ($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table || $isForced) {
            $sql = "CREATE TABLE $table (
                `id` BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
                `term_id` BIGINT UNSIGNED NULL,
                `post_id` BIGINT UNSIGNED NULL,
                `created_at` TIMESTAMP NULL,
                `updated_at` TIMESTAMP NULL,
                INDEX `{$indexPrefix}_term_id` (`term_id`),
                INDEX `{$indexPrefix}_post_id` (`post_id`)
            ) $charsetCollate;";
            dbDelta($sql);
        }
    }
}

```
