PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / trunk
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration vtrunk
2.0.15 2.0.12 2.0.10 2.0.4 2.0.1 2.0.0 1.95.3 1.95.2 1.95 1.91.6 trunk 1.11 1.12 1.13 1.20 1.21 1.22 1.23 1.30 1.31 1.32 1.35 1.40 1.41 1.45 All 41 releases
fluent-boards / database / Migrations / NotificationMigrator.php

NotificationMigrator.php in FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration trunk, at database/Migrations/NotificationMigrator.php

43 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentBoards\Database\Migrations;
4
5 class NotificationMigrator
6 {
7 /**
8 * Task Management Table.
9 *
10 * @param bool $isForced
11 * @return void
12 */
13 public static function migrate($isForced = true)
14 {
15 global $wpdb;
16
17 $charsetCollate = $wpdb->get_charset_collate();
18 $table = $wpdb->prefix . 'fbs_notifications';
19
20 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Schema check query, caching not applicable for migrations
21 if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $table)) != $table || $isForced) {
22 // phpcs:ignore WordPress.DB.DirectDatabaseQuery.SchemaChange -- Table name cannot be prepared in CREATE TABLE
23 $sql = "CREATE TABLE $table (
24 `id` INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
25 `object_id` INT UNSIGNED NOT NULL,
26 `object_type` VARCHAR(100) NOT NULL,
27 `task_id` INT UNSIGNED NULL,
28 `action` VARCHAR(255) NULL COMMENT 'this will be the hooks_name like task_created, priority_changed, etc.',
29 `activity_by` BIGINT UNSIGNED NOT NULL,
30 `description` LONGTEXT NULL,
31 `settings` TEXT NULL COMMENT 'JSON Serialized Array',
32 `created_at` TIMESTAMP NULL,
33 `updated_at` TIMESTAMP NULL,
34 KEY `object_id` (`object_id`),
35 KEY `object_type` (`object_type`),
36 KEY `activity_by` (`activity_by`)
37 ) $charsetCollate;";
38 require_once ABSPATH . 'wp-admin/includes/upgrade.php';
39 dbDelta($sql);
40 }
41 }
42 }
43