PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 1.2.4
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v1.2.4
6.2.13 6.2.12 6.2.10 6.2.11 6.2.9 6.2.8 6.2.7 6.2.6 6.2.5 6.2.4 6.2.3 6.2.2 3.6.22 3.6.31 3.6.40 3.6.41 3.6.42 3.6.50 3.6.51 3.6.60 3.6.61 3.6.62 3.6.64 3.6.65 3.6.66 All 195 releases
fluentform / app / Databases / Migrations / FormSubmissionMeta.php

FormSubmissionMeta.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 1.2.4, at app/Databases/Migrations/FormSubmissionMeta.php

53 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\App\Databases\Migrations;
4
5 class FormSubmissionMeta
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
18 $table = $wpdb->prefix.'fluentform_submission_meta';
19
20 $submissionsTable = $wpdb->prefix.'fluentform_submissions';
21
22 $formTable = $wpdb->prefix.'fluentform_forms';
23
24 if ($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) {
25 $sql = "CREATE TABLE $table (
26 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
27 `response_id` BIGINT(20) UNSIGNED NULL,
28 `form_id` INT UNSIGNED NULL,
29 `meta_key` VARCHAR(45) NULL,
30 `value` LONGTEXT NULL,
31 `status` VARCHAR(45) NULL,
32 `user_id` INT UNSIGNED NULL,
33 `name` VARCHAR(45) NULL,
34 `created_at` TIMESTAMP NULL,
35 `updated_at` TIMESTAMP NULL,
36 PRIMARY KEY (`id`),
37 INDEX `fluent_response_id_idx` (`response_id` ASC),
38 CONSTRAINT `fk_fluent_response_meta_response_id`
39 FOREIGN KEY (`response_id`)
40 REFERENCES $submissionsTable (`id`)
41 ON DELETE CASCADE
42 ON UPDATE CASCADE,
43 CONSTRAINT `fk_fluent_response_meta_form_id`
44 FOREIGN KEY (`form_id`)
45 REFERENCES $formTable (`id`)
46 ON DELETE CASCADE
47 ON UPDATE CASCADE) $charsetCollate;";
48
49 require_once(ABSPATH.'wp-admin/includes/upgrade.php');
50 dbDelta($sql);
51 }
52 }
53 }