You are here

function uc_recurring_update_6000 in UC Recurring Payments and Subscriptions 6

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

File

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

Code

function uc_recurring_update_6000() {
  $ret = array();
  db_drop_primary_key($ret, 'uc_recurring_products');
  db_change_field($ret, 'uc_recurring_products', 'pfid', 'pfid', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ), array(
    'primary key' => array(
      'pfid',
    ),
  ));
  db_change_field($ret, 'uc_recurring_products', 'fee_amount', 'fee_amount', array(
    'type' => 'numeric',
    'precision' => 10,
    'scale' => 2,
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'uc_recurring_products', 'number_intervals', 'number_intervals', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'size' => 'small',
    'not null' => TRUE,
    'default' => 1,
  ));
  db_drop_primary_key($ret, 'uc_recurring_users');
  db_change_field($ret, 'uc_recurring_users', 'rfid', 'rfid', array(
    'type' => 'serial',
    'unsigned' => TRUE,
    'not null' => TRUE,
  ), array(
    'primary key' => array(
      'rfid',
    ),
  ));
  db_change_field($ret, 'uc_recurring_users', 'uid', 'uid', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'uc_recurring_users', 'next_charge', 'next_charge', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'uc_recurring_users', 'fee_amount', 'fee_amount', array(
    'type' => 'numeric',
    'precision' => 10,
    'scale' => 2,
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'uc_recurring_users', 'remaining_intervals', 'remaining_intervals', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'size' => 'small',
    'not null' => TRUE,
    'default' => 1,
  ));
  db_change_field($ret, 'uc_recurring_users', 'charged_intervals', 'charged_intervals', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'size' => 'small',
    'not null' => TRUE,
    'default' => 1,
  ));
  db_change_field($ret, 'uc_recurring_users', 'order_id', 'order_id', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  db_change_field($ret, 'uc_recurring_users', 'created', 'created', array(
    'type' => 'int',
    'unsigned' => TRUE,
    'not null' => TRUE,
    'default' => 0,
  ));
  return $ret;
}