You are here

function uc_recurring_update_6011 in UC Recurring Payments and Subscriptions 6.2

Same name and namespace in other branches
  1. 7.2 uc_recurring.install \uc_recurring_update_6011()

Move product recurring feature to its own module. Add field to indicate which module handles the recurring fee.

File

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

Code

function uc_recurring_update_6011() {
  $ret = array();
  drupal_install_modules(array(
    'uc_recurring_product',
  ));
  db_drop_field($ret, 'uc_recurring_products', 'nid');
  $ret[] = update_sql("INSERT INTO {uc_recurring_product} SELECT * FROM {uc_recurring_products}");
  db_drop_table($ret, 'uc_recurring_products');
  db_add_field($ret, 'uc_recurring_users', 'module', array(
    'type' => 'varchar',
    'length' => '255',
    'not null' => TRUE,
    'default' => '',
  ));
  $ret[] = update_sql("UPDATE {uc_recurring_users} SET module = 'uc_recurring_order' WHERE data LIKE '%uc_recurring_order%'");
  $ret[] = update_sql("UPDATE {uc_recurring_users} SET module = 'uc_recurring_product' WHERE module = ''");
  return $ret;
}