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 / FormSubmissions.php

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

57 lines 1.6 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 FormSubmissions
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_submissions';
19
20 $formTable = $wpdb->prefix.'fluentform_forms';
21
22 if ($wpdb->get_var("SHOW TABLES LIKE '$table'") != $table) {
23 $sql = "CREATE TABLE $table (
24 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
25 `form_id` INT UNSIGNED NULL,
26 `serial_number` INT UNSIGNED NULL,
27 `response` LONGTEXT NULL,
28 `source_url` VARCHAR(255) NULL,
29 `user_id` INT UNSIGNED NULL,
30 `status` VARCHAR(45) NULL DEFAULT 'unread' COMMENT 'possible values: read, unread, trashed',
31 `is_favourite` TINYINT(1) NOT NULL DEFAULT 0,
32 `browser` VARCHAR(45) NULL,
33 `device` VARCHAR(45) NULL,
34 `ip` VARCHAR(45) NULL,
35 `city` VARCHAR(45) NULL,
36 `country` VARCHAR(45) NULL,
37 `payment_status` VARCHAR(45) NULL,
38 `payment_method` VARCHAR(45) NULL,
39 `payment_type` VARCHAR(45) NULL,
40 `currency` VARCHAR(45) NULL,
41 `total_paid` FLOAT NULL,
42 `created_at` TIMESTAMP NULL,
43 `updated_at` TIMESTAMP NULL,
44 PRIMARY KEY (`id`),
45 INDEX `fluent_form_id_idx` (`form_id` ASC),
46 CONSTRAINT `fk_fluent_responses_form_id`
47 FOREIGN KEY (`form_id`)
48 REFERENCES $formTable (`id`)
49 ON DELETE CASCADE
50 ON UPDATE CASCADE) $charsetCollate;";
51
52 require_once(ABSPATH.'wp-admin/includes/upgrade.php');
53
54 dbDelta($sql);
55 }
56 }
57 }