Skip to content

Commit

Permalink
fix(db-update): add update to correct plugin version
Browse files Browse the repository at this point in the history
ref #2710
  • Loading branch information
ravinderk committed Jul 25, 2018
1 parent 25a383d commit 52899de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions includes/admin/upgrades/upgrade-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,9 +370,9 @@ function give_show_upgrade_notices( $give_updates ) {
// v2.1.3 Verify Form Status Upgrade.
$give_updates->register(
array(
'id' => 'v213_rename_donation_meta_type',
'id' => 'v220_rename_donation_meta_type',
'version' => '2.1.3',
'callback' => 'give_v213_rename_donation_meta_type_callback',
'callback' => 'give_v220_rename_donation_meta_type_callback',
'depend' => array( 'v20_move_metadata_into_new_table' ),
)
);
Expand Down Expand Up @@ -2798,16 +2798,16 @@ function give_v213_delete_donation_meta_callback() {
*
* @see https://github.com/restrictcontentpro/restrict-content-pro/issues/1656
*
* @since 2.1.3
* @since 2.2.0
*/
function give_v213_rename_donation_meta_type_callback(){
function give_v220_rename_donation_meta_type_callback(){
global $wpdb;
$give_updates = Give_Updates::get_instance();

$wpdb->query( "ALTER TABLE {$wpdb->prefix}give_paymentmeta CHANGE COLUMN payment_id donation_id bigint(20)" );
$wpdb->query( "ALTER TABLE {$wpdb->prefix}give_paymentmeta RENAME TO {$wpdb->prefix}give_donationmeta" );

give_set_upgrade_complete('v213_rename_donation_meta_type');
give_set_upgrade_complete('v220_rename_donation_meta_type');
$give_updates->set_percentage(1, 1);
}

Expand Down
2 changes: 1 addition & 1 deletion includes/class-give-db-payment-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function __construct() {
$this->version = '1.0';

// Backward compatibility.
if ( ! give_has_upgrade_completed( 'v213_rename_donation_meta_type' ) ) {
if ( ! give_has_upgrade_completed( 'v220_rename_donation_meta_type' ) ) {
$this->meta_type = 'payment';
$wpdb->paymentmeta = $wpdb->donationmeta = $this->table_name = $wpdb->prefix . 'give_paymentmeta';
}
Expand Down
2 changes: 1 addition & 1 deletion includes/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ function give_run_install() {
'v201_logs_upgrades',
'v210_verify_form_status_upgrades',
'v213_delete_donation_meta',
'v213_rename_donation_meta_type',
'v220_rename_donation_meta_type',
'v215_update_donor_user_roles',
'v220_delete_wp_session_data'
);
Expand Down

0 comments on commit 52899de

Please sign in to comment.