You are here

function uc_recurring_update_1 in UC Recurring Payments and Subscriptions 7.2

Same name and namespace in other branches
  1. 6.2 uc_recurring.install \uc_recurring_update_1()
  2. 6 uc_recurring.install \uc_recurring_update_1()

Add a column to store the recurring fee handler with the user subscription.

File

./uc_recurring.install, line 263
Installs the Recurring Fee module.

Code

function uc_recurring_update_1() {

  // Add a column to store the recurring fee handler with the user subscription.
  db_add_field('uc_recurring_users', 'fee_handler', array(
    'type' => 'varchar',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
  ));

  // Update existing rows if uc_recurring is the current handler.
  if (variable_get('uc_recurring_handler', 'uc_recurring') == 'uc_recurring') {
    db_query("UPDATE {uc_recurring_users} SET fee_handler = 'uc_recurring'");
  }
}