# fluent-boards/1.45/database/Migrations/TaskMetaMigrator.php

FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration, version 1.45. 35 lines.

- Page: https://pluginprobe.com/plugins/fluent-boards/1.45/code/database/Migrations/TaskMetaMigrator.php
- Raw: https://pluginprobe.com/plugins/fluent-boards/1.45/raw/database/Migrations/TaskMetaMigrator.php
- Modified: 2024-05-31T06:41:46+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-boards/1.45/code/database/Migrations/TaskMetaMigrator.php#L10-L20`.

```php
<?php

namespace FluentBoards\Database\Migrations;

class TaskMetaMigrator
{
    /**
     * Task Meta Table.
     *
     * @param  bool $isForced
     * @return void
     */
    public static function migrate($isForced = true)
    {
        global $wpdb;

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

        if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $table)) != $table || $isForced) {
            $sql = "CREATE TABLE $table (
                `id` INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
                `task_id` INT UNSIGNED NOT NULL,
                `key` VARCHAR(100) NOT NULL,
                `value` LONGTEXT NULL,
                `created_at` TIMESTAMP NULL,
                `updated_at` TIMESTAMP NULL,
                KEY `task_id` (`task_id`)
            ) $charsetCollate;";
            require_once ABSPATH . 'wp-admin/includes/upgrade.php';
            dbDelta($sql);
        }
    }
}

```
