PluginProbe
Fluent Support – Helpdesk & Customer Support Ticket System / 2.2.1
Fluent Support – Helpdesk & Customer Support Ticket System v2.2.1
2.3.2 2.3.1 2.3.0 2.2.1 2.2.0 trunk 1.10.0 1.10.1 1.10.2 1.10.3 1.10.4 1.10.5 1.4.0 1.4.1 1.4.2 1.4.5 1.4.6 1.4.7 1.5.0 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 All 67 releases
fluent-support / database / Migrations / NotificationsMigrator.php

NotificationsMigrator.php in Fluent Support – Helpdesk & Customer Support Ticket System 2.2.1, at database/Migrations/NotificationsMigrator.php

40 lines 1.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentSupport\Database\Migrations;
4
5 class NotificationsMigrator
6 {
7 static $tableName = 'fs_notifications';
8
9 public static function migrate()
10 {
11 global $wpdb;
12
13 $charsetCollate = $wpdb->get_charset_collate();
14 $table = $wpdb->prefix . static::$tableName;
15
16 if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $table)) !== $table) {
17 $sql = "CREATE TABLE $table (
18 `id` BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
19 `actor_id` BIGINT(20) UNSIGNED NULL,
20 `ticket_id` BIGINT(20) UNSIGNED NULL,
21 `conversation_id` BIGINT(20) UNSIGNED NULL,
22 `event_type` VARCHAR(192) NOT NULL,
23 `category` VARCHAR(100) NOT NULL,
24 `payload` LONGTEXT NULL,
25 `created_at` TIMESTAMP NULL,
26 `updated_at` TIMESTAMP NULL,
27 INDEX `idx_conversation_id` (`conversation_id`),
28 INDEX `idx_event_type` (`event_type`),
29 INDEX `idx_created_at` (`created_at`),
30 INDEX `idx_category_created_at` (`category`, `created_at`),
31 INDEX `idx_ticket_created_at` (`ticket_id`, `created_at`)
32 ) $charsetCollate;";
33
34 return dbDelta($sql);
35 }
36
37 return false;
38 }
39 }
40