Diff: STRATO-apps/wordpress_03/app/wp-content/plugins/fluentform/database/Migrations/ScheduledActions.php

Keine Baseline-Datei – Diff nur gegen leer.
Zur Liste
1 -
1 + <?php
2 +
3 + namespace FluentForm\Database\Migrations;
4 +
5 + class ScheduledActions
6 + {
7 + /**
8 + * Migrate the table.
9 + *
10 + * @return void
11 + */
12 + public static function migrate()
13 + {
14 + global $wpdb;
15 +
16 + $charsetCollate = $wpdb->get_charset_collate();
17 + $table = $wpdb->prefix . 'ff_scheduled_actions';
18 + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Migration file, direct query needed
19 + if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s", $table)) != $table) {
20 + // phpcs:ignore WordPress.DB.DirectDatabaseQuery.SchemaChange -- Migration file, schema change is the purpose
21 + $sql = "CREATE TABLE $table (
22 + `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
23 + `action` VARCHAR(255) NULL,
24 + `form_id` BIGINT(20) UNSIGNED NULL,
25 + `origin_id` BIGINT(20) UNSIGNED NULL,
26 + `feed_id` BIGINT(20) UNSIGNED NULL,
27 + `type` VARCHAR(255) DEFAULT 'submission_action',
28 + `status` VARCHAR(255) NULL,
29 + `data` LONGTEXT NULL,
30 + `note` TINYTEXT NULL,
31 + `retry_count` INT UNSIGNED DEFAULT 0,
32 + `created_at` TIMESTAMP NULL,
33 + `updated_at` TIMESTAMP NULL,
34 + PRIMARY KEY (`id`)) $charsetCollate;";
35 + require_once ABSPATH . 'wp-admin/includes/upgrade.php';
36 + dbDelta($sql);
37 + }
38 +
39 + update_option('fluentform_scheduled_actions_migrated', 'yes', 'no');
40 + }
41 + }
42 +