You are here

function uc_varprice_schema in UC Variable Price 6

Same name and namespace in other branches
  1. 7 uc_varprice.install \uc_varprice_schema()

@file Installs the necessary table for the Variable Price product features.

1 call to uc_varprice_schema()
uc_varprice_update_6001 in ./uc_varprice.install

File

./uc_varprice.install, line 9
Installs the necessary table for the Variable Price product features.

Code

function uc_varprice_schema() {
  $schema = array();
  $schema['uc_varprice_products'] = array(
    'fields' => array(
      'vpid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'pfid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'price_default' => array(
        'description' => t('Default product price.'),
        'type' => 'numeric',
        'precision' => 10,
        'scale' => 2,
        'not null' => TRUE,
        'default' => 0.0,
      ),
      'price_minimum' => array(
        'description' => t('Minimum product price.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'price_maximum' => array(
        'description' => t('Maximum product price.'),
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'add_to_cart_title' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'amount_title' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'arbitrary' => array(
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'selectable' => array(
        'type' => 'int',
        'size' => 'tiny',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'sel_widget' => array(
        'type' => 'varchar',
        'length' => 8,
        'not null' => TRUE,
        'default' => 'radios',
      ),
      'sel_options' => array(
        'type' => 'text',
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'indexes' => array(
      'pfid' => array(
        'pfid',
      ),
    ),
    'primary key' => array(
      'vpid',
    ),
  );
  return $schema;
}