PluginProbe
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration / 1.21
FluentBoards – Project Management, Task Management, Goal Tracking, Kanban Board, and, Team Collaboration v1.21
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 / AttachmentMigrator.php

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

48 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 AttachmentMigrator
6 {
7 /**
8 * Attachments Table.
9 * @param bool $isForced
10 * @return void
11 */
12 public static function migrate($isForced = true)
13 {
14 global $wpdb;
15
16 $charsetCollate = $wpdb->get_charset_collate();
17
18 $table = $wpdb->prefix . 'fbs_attachments';
19
20 if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $table)) != $table || $isForced) {
21 $sql = "CREATE TABLE $table (
22 `id` INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
23 `object_id` INT UNSIGNED NOT NULL COMMENT 'Task ID or Comment ID or Board ID',
24 `object_type` VARCHAR(100) DEFAULT 'TASK' COMMENT 'TASK|COMMENT|BOARD',
25 `attachment_type` VARCHAR(100) NULL,
26 `file_path` TEXT NULL,
27 `full_url` TEXT NULL,
28 `settings` TEXT NULL,
29 `title` VARCHAR(192) NULL,
30 `file_hash` VARCHAR(192) NULL,
31 `driver` VARCHAR(100) DEFAULT 'local',
32 `status` VARCHAR(100) NULL DEFAULT 'ACTIVE' COMMENT 'ACTIVE|INACTIVE|DELETED',
33 `file_size` VARCHAR(100) NULL,
34 `created_at` TIMESTAMP NULL,
35 `updated_at` TIMESTAMP NULL,
36 KEY `object_type` (`object_type`),
37 KEY `object_id` (`object_id`),
38 KEY `attachment_type` (`attachment_type`),
39 KEY `status` (`status`),
40 KEY `file_hash` (`file_hash`),
41 KEY `driver` (`driver`)
42 ) $charsetCollate;";
43 require_once ABSPATH . 'wp-admin/includes/upgrade.php';
44 dbDelta($sql);
45 }
46 }
47 }
48