# fluent-community/2.7.7/database/Migrations/UserActivitiesMigrator.php

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

- Page: https://pluginprobe.com/plugins/fluent-community/2.7.7/code/database/Migrations/UserActivitiesMigrator.php
- Raw: https://pluginprobe.com/plugins/fluent-community/2.7.7/raw/database/Migrations/UserActivitiesMigrator.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.7.7/code/database/Migrations/UserActivitiesMigrator.php#L10-L20`.

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

namespace FluentCommunity\Database\Migrations;

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

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

        if ($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table || $isForced) {
            $sql = "CREATE TABLE $table (
                `id` BIGINT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
                `user_id` BIGINT UNSIGNED NULL,
                `feed_id` BIGINT UNSIGNED NULL,
                `space_id` BIGINT UNSIGNED NULL,
                `related_id` BIGINT UNSIGNED NULL,
                `message` TEXT NULL,
                `is_public` TINYINT(1) NULL DEFAULT 1,
                `action_name` VARCHAR(100) NULL DEFAULT '',
                `created_at` TIMESTAMP NULL,
                `updated_at` TIMESTAMP NULL,
                INDEX `feed_id` (`feed_id`),
                INDEX `user_id` (`user_id`),
                INDEX `action_name` (`action_name`)
            ) $charsetCollate;";
            dbDelta($sql);
        }
    }
}

```
