You are here

function uc_recurring_update_6000 in UC Recurring Payments and Subscriptions 7.2

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

Normalize the columns in {uc_recurring_products} and {uc_recurring_users}.

File

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

Code

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