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

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

59 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 FormTransactions
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_transactions';
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` INT UNSIGNED NOT NULL AUTO_INCREMENT,
27 `form_id` INT UNSIGNED NULL,
28 `response_id` BIGINT(20) UNSIGNED NULL,
29 `currency` VARCHAR(45) NULL,
30 `charge_id` VARCHAR(45) NULL,
31 `card_type` VARCHAR(45) NULL,
32 `amount` VARCHAR(45) NULL,
33 `payment_method` VARCHAR(45) NULL,
34 `payment_status` VARCHAR(45) NULL,
35 `payment_type` VARCHAR(45) NULL,
36 `payer_email` VARCHAR(255) NULL,
37 `user_id` INT UNSIGNED NULL,
38 `created_at` TIMESTAMP NULL,
39 `updated_at` TIMESTAMP NULL,
40 PRIMARY KEY (`id`),
41 INDEX `form_id_idx` (`form_id` ASC),
42 INDEX `response_id_idx` (`response_id` ASC),
43 CONSTRAINT `fk_fluent_transactions_form_id`
44 FOREIGN KEY (`form_id`)
45 REFERENCES $formTable (`id`)
46 ON DELETE CASCADE
47 ON UPDATE CASCADE,
48 CONSTRAINT `fk_fluent_transactions_response_id`
49 FOREIGN KEY (`response_id`)
50 REFERENCES $submissionsTable (`id`)
51 ON DELETE CASCADE
52 ON UPDATE CASCADE ) $charsetCollate;";
53
54 require_once(ABSPATH.'wp-admin/includes/upgrade.php');
55
56 dbDelta($sql);
57 }
58 }
59 }