1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
<?php
class DFW_Update_DB {
public static function dfw_update_plans_db() {
global $wpdb;
if ( $wpdb->get_var( "SHOW TABLES LIKE '{$wpdb->prefix}dfw_deposits_payment_plans_schedule'; " ) ) {
if ( ! $wpdb->get_var( "SHOW COLUMNS FROM {$wpdb->prefix}dfw_deposits_payment_plans_schedule LIKE 'plan_due';" ) ) {
$wpdb->query( "ALTER TABLE {$wpdb->prefix}dfw_deposits_payment_plans_schedule ADD `plan_due` text NOT NULL AFTER `plan_amount`;" );
}
}
}
}