PluginProbe
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder / 3.3.1
Bit Form – Contact Form, Payment Forms, Multi Step Forms, Calculator & Custom Form Builder v3.3.1
3.3.1 V-3.3.0 3.2.2 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 V3.0.3 V3.0.2 -3.0.1 V_3.0.0 1.1.1 1.1.8 1.2 1.3 1.4 1.4.18 1.5.2 1.9 2.0 2.10.0 2.10.1 All 138 releases
← All changes | includes/Core/Database/DB.php +56 -0 3.2.23.3.1 View file →
@@ -78,8 +78,64 @@
78 78 );
79 79 }
80 80 }
81 81
82 + /**
83 + * Idempotently add the workflows `workflow_order` column.
84 + *
85 + * @return void
86 + */
87 + public static function ensureWorkflowOrderColumn()
88 + {
89 + global $wpdb;
90 + $table = $wpdb->prefix . 'bitforms_workflows';
91 + if (null === $wpdb->get_var("SHOW COLUMNS FROM `{$table}` LIKE 'workflow_order'")) {
92 + $wpdb->query(
93 + "ALTER TABLE `{$table}`
94 + ADD COLUMN `workflow_order` INT(11) DEFAULT NULL AFTER `workflow_condition`"
95 + );
96 + }
97 + }
98 +
99 + /**
100 + * Idempotently add the workflows `workflow_status` column.
101 + *
102 + * @return void
103 + */
104 + public static function ensureWorkflowStatusColumn()
105 + {
106 + self::ensureWorkflowOrderColumn();
107 + global $wpdb;
108 + $table = $wpdb->prefix . 'bitforms_workflows';
109 + if (null === $wpdb->get_var("SHOW COLUMNS FROM `{$table}` LIKE 'workflow_status'")) {
110 + $wpdb->query(
111 + "ALTER TABLE `{$table}`
112 + ADD COLUMN `workflow_status` TINYINT(1) DEFAULT 1 NOT NULL AFTER `workflow_order`"
113 + );
114 + }
115 + }
116 +
117 + /**
118 + * Idempotently add every workflows column the queries reference, for installs whose
119 + * `bitforms_db_version` ran ahead of their real schema (a version-gated ALTER failed once).
120 + *
121 + * @return bool true when all four columns exist afterwards
122 + */
123 + public static function ensureWorkflowSchema()
124 + {
125 + global $wpdb;
126 + self::ensureWorkflowStatusColumn();
127 + self::ensureWorkflowCategoryColumn();
128 +
129 + $table = $wpdb->prefix . 'bitforms_workflows';
130 + foreach (['workflow_order', 'workflow_info', 'workflow_category', 'workflow_status'] as $column) {
131 + if (null === $wpdb->get_var("SHOW COLUMNS FROM `{$table}` LIKE '{$column}'")) {
132 + return false;
133 + }
134 + }
135 + return true;
136 + }
137 +
82 138 public static function migrate()
83 139 {
84 140 global $wpdb;
85 141 global $bitforms_db_version;