You are here

function uc_product_kit_schema in Ubercart 6.2

Same name and namespace in other branches
  1. 8.4 uc_product_kit/uc_product_kit.install \uc_product_kit_schema()
  2. 7.3 uc_product_kit/uc_product_kit.install \uc_product_kit_schema()

Implements hook_schema().

File

uc_product_kit/uc_product_kit.install, line 11
Install, update and uninstall functions for the uc_product_kit module.

Code

function uc_product_kit_schema() {
  $schema['uc_product_kits'] = array(
    'description' => 'Stores product kit information.',
    'fields' => array(
      'vid' => array(
        'description' => 'The {node}.vid of the product kit.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'description' => 'The {node}.nid of the product kit.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'product_id' => array(
        'description' => 'The {uc_products}.nid of a product contained in the kit.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'mutable' => array(
        'description' => 'A flag indicating whether the contents of the kit can be changed by the customer. 1 => Mutable. 0 => Immutable.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
      'qty' => array(
        'description' => 'The number of this product contained in the kit.',
        'type' => 'int',
        'size' => 'small',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'discount' => array(
        'description' => 'The adjustment to the {uc_products}.sell_price of the product.',
        'type' => 'float',
        'not null' => TRUE,
        'default' => 0.0,
      ),
      'ordering' => array(
        'description' => 'The weight of this product in relation to other products in the kit.',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
      'synchronized' => array(
        'description' => 'A flag indicating that changes to the sell price of this product will change the total price of the kit. 1 => Yes. 0 => No.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'vid',
      'product_id',
    ),
  );
  return $schema;
}