@@ -34,7 +34,7 @@ class CRM_Stripe_Upgrader extends CRM_Stripe_Upgrader_Base {
// Add is_live column to civicrm_stripe_plans and civicrm_stripe_customers tables.
$sql="SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = %1 AND TABLE_NAME = 'civicrm_stripe_customers' AND COLUMN_NAME = 'is_live'";
$this->ctx->log->info('Applying civicrm_stripe update 1903. Adding is_live to civicrm_stripe_plans and civicrm_stripe_customers tables.');
...
...
@@ -58,7 +58,7 @@ class CRM_Stripe_Upgrader extends CRM_Stripe_Upgrader_Base {
$dbName=DB::connect($config->dsn)->_db;
$sql="SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = %1 AND TABLE_NAME = 'civicrm_stripe_customers' AND COLUMN_NAME = 'processor_id'";
CRM_Core_DAO::executeQuery('UPDATE `civicrm_stripe_customers` SET processor_id = %1 where processor_id IS NULL and is_live = 1',$p);
CRM_Core_DAO::executeQuery('UPDATE `civicrm_stripe_customers` SET processor_id = %2 where processor_id IS NULL and is_live = 0',$p);
CRM_Core_DAO::executeQuery('UPDATE `civicrm_stripe_plans` SET processor_id = %1 where processor_id IS NULL and is_live = 1',$p);
...
...
@@ -133,7 +133,7 @@ class CRM_Stripe_Upgrader extends CRM_Stripe_Upgrader_Base {
$dbName=DB::connect($config->dsn)->_db;
$sql="SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = %1 AND TABLE_NAME = 'civicrm_stripe_subscriptions' AND COLUMN_NAME = 'subscription_id'";
CRM_Core_DAO::executeQuery('UPDATE civicrm_stripe_subscriptions SET subscription_id = %1 where customer_id = %2;',$query_params);
unset($subscription);
}
...
...
@@ -204,7 +203,7 @@ class CRM_Stripe_Upgrader extends CRM_Stripe_Upgrader_Base {
$dbName=DB::connect($config->dsn)->_db;
$sql="SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = %1 AND TABLE_NAME = 'civicrm_stripe_subscriptions' AND COLUMN_NAME = 'contribution_recur_id'";
CRM_Core_DAO::executeQuery('UPDATE civicrm_stripe_subscriptions SET contribution_recur_id = %1 WHERE invoice_id = %2;',$p);
}
}
...
...
@@ -271,7 +270,7 @@ class CRM_Stripe_Upgrader extends CRM_Stripe_Upgrader_Base {
$dbName=DB::connect($config->dsn)->_db;
$sql="SELECT COLUMN_NAME FROM information_schema.COLUMNS WHERE TABLE_SCHEMA = %1 AND TABLE_NAME = 'civicrm_stripe_subscriptions' AND COLUMN_NAME = 'invoice_id'";