You are here

function uc_roles_update_6003 in Ubercart 6.2

Add the stuff to allow absolute ending expiration times. The code has also been laid here for absolute start times, but has not been fully implemented as yet.

File

uc_roles/uc_roles.install, line 236
Install, update and uninstall functions for the uc_roles module.

Code

function uc_roles_update_6003() {
  $ret = array();
  $schema = array(
    // Start of expiation period
    'start_override' => array(
      'description' => 'Fallthrough to the default start time?',
      'type' => 'int',
      'size' => 'tiny',
      'not null' => FALSE,
      'default' => 0,
    ),
    'start_time' => array(
      'description' => 'Role expiration start time. 0 signifies to start at product purchase.',
      'type' => 'int',
      'not null' => FALSE,
      'default' => 0,
    ),
    // End of expiation period
    'end_override' => array(
      'description' => 'Fallthrough to the default end time?',
      'type' => 'int',
      'size' => 'tiny',
      'not null' => FALSE,
      'default' => 0,
    ),
    'end_time' => array(
      'description' => 'Role expiration end time. 0 signifies to use relative expiration.',
      'type' => 'int',
      'not null' => FALSE,
      'default' => 0,
    ),
  );
  db_add_field($ret, 'uc_roles_products', 'start_time', $schema['start_time']);
  db_add_field($ret, 'uc_roles_products', 'start_override', $schema['start_override']);
  db_add_field($ret, 'uc_roles_products', 'end_time', $schema['end_time']);
  db_add_field($ret, 'uc_roles_products', 'end_override', $schema['end_override']);
  return $ret;
}