Skip to content

Commit 1099eab

Browse files
Merge pull request #70 from django101/master
Fixed paid_at field not being set in the database when updating the plugin
2 parents 0cebd7a + c48e84b commit 1099eab

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

includes/class-paystack-forms-activator.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,5 +74,13 @@ public static function activate()
7474
if (empty($row1)) {
7575
$wpdb->query("ALTER TABLE `" . $table_name . "` ADD `txn_code_2` VARCHAR(255) DEFAULT '' NULL AFTER `txn_code`;");
7676
}
77+
78+
$row1 = $wpdb->get_results(
79+
"SELECT COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS
80+
WHERE table_name = '" . $table_name . "' AND column_name = 'paid_at'"
81+
);
82+
if (empty($row1)) {
83+
$wpdb->query("ALTER TABLE `" . $table_name . "` ADD `paid_at` timestamp AFTER `created_at`;");
84+
}
7785
}
7886
}

0 commit comments

Comments
 (0)