You are here

function uc_atctweaks_schema in UC Add to Cart Tweaks 7

Same name and namespace in other branches
  1. 6 uc_atctweaks.install \uc_atctweaks_schema()

Implementation of hook_schema()

File

./uc_atctweaks.install, line 12
Installs the necessary table for the Add to Cart Tweaks product features.

Code

function uc_atctweaks_schema() {
  $schema = array();
  $schema['uc_atctweaks_products'] = array(
    'fields' => array(
      'vpid' => array(
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'pfid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'cart_empty' => array(
        'description' => 'Cart empty setting for this instance of the feature.',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
      'redirect' => array(
        'description' => 'Add to cart redirect for this instance of the feature.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'indexes' => array(
      'pfid' => array(
        'pfid',
      ),
    ),
    'primary key' => array(
      'vpid',
    ),
  );
  return $schema;
}