PluginProbe
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder / 6.0.0
Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder v6.0.0
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 / database / Migrations / Submissions.php

Submissions.php in Fluent Forms – Customizable Contact Forms, Survey, Quiz, & Conversational Form Builder 6.0.0, at database/Migrations/Submissions.php

52 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace FluentForm\Database\Migrations;
4
5 class Submissions
6 {
7 /**
8 * Migrate the table.
9 *
10 * @return void
11 */
12 public static function migrate($force = false)
13 {
14 global $wpdb;
15
16 $charsetCollate = $wpdb->get_charset_collate();
17
18 $table = $wpdb->prefix . 'fluentform_submissions';
19
20 $sql = "CREATE TABLE $table (
21 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
22 `form_id` INT UNSIGNED NULL,
23 `serial_number` INT UNSIGNED NULL,
24 `response` LONGTEXT NULL,
25 `source_url` VARCHAR(255) NULL,
26 `user_id` INT UNSIGNED NULL,
27 `status` VARCHAR(45) NULL DEFAULT 'unread' COMMENT 'possible values: read, unread, trashed',
28 `is_favourite` TINYINT(1) NOT NULL DEFAULT 0,
29 `browser` VARCHAR(45) NULL,
30 `device` VARCHAR(45) NULL,
31 `ip` VARCHAR(45) NULL,
32 `city` VARCHAR(45) NULL,
33 `country` VARCHAR(45) NULL,
34 `payment_status` VARCHAR(45) NULL,
35 `payment_method` VARCHAR(45) NULL,
36 `payment_type` VARCHAR(45) NULL,
37 `currency` VARCHAR(45) NULL,
38 `payment_total` FLOAT NULL,
39 `total_paid` FLOAT NULL,
40 `created_at` TIMESTAMP NULL,
41 `updated_at` TIMESTAMP NULL,
42 PRIMARY KEY (`id`)) $charsetCollate;";
43
44 $hasTable = $wpdb->get_var("SHOW TABLES LIKE '$table'") != $table;
45
46 if ($force || !$hasTable) {
47 require_once ABSPATH . 'wp-admin/includes/upgrade.php';
48 dbDelta($sql);
49 }
50 }
51 }
52