You are here

function commerce_pricing_attributes_schema in Commerce Pricing Attributes 7.2

Implements hook_schema().

File

./commerce_pricing_attributes.install, line 6

Code

function commerce_pricing_attributes_schema() {
  $schema['commerce_pricing_attributes'] = array(
    'description' => 'The base table for attributes lines.',
    'fields' => array(
      'attribute_id' => array(
        'description' => 'The primary identifier for the attribute.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'The {commerce_product}.type of this attribute.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'line_item_id' => array(
        'description' => 'The {commerce_line_item}.line_item_id that is linked with this attribute.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'created' => array(
        'description' => 'The Unix timestamp when the attribute was created.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'changed' => array(
        'description' => 'The Unix timestamp when the product was most recently saved.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'attribute_id',
    ),
    'indexes' => array(
      'type' => array(
        'type',
      ),
      'line_item_id' => array(
        'line_item_id',
      ),
    ),
    'foreign keys' => array(
      'line_item' => array(
        'table' => 'commerce_line_item',
        'columns' => array(
          'line_item_id' => 'line_item_id',
        ),
      ),
    ),
  );
  return $schema;
}