You are here

function basic_cart_schema in Basic cart 8.5

Same name and namespace in other branches
  1. 8.6 basic_cart.install \basic_cart_schema()
  2. 8 basic_cart.install \basic_cart_schema()
  3. 8.0 basic_cart.install \basic_cart_schema()
  4. 8.2 basic_cart.install \basic_cart_schema()
  5. 8.3 basic_cart.install \basic_cart_schema()
  6. 8.4 basic_cart.install \basic_cart_schema()

Implements hook_schema().

Defines the database tables used by this module.

See also

hook_schema()

File

./basic_cart.install, line 17
Install, update and uninstall functions for the dbtng_example module.

Code

function basic_cart_schema() {
  $schema['basic_cart_order_connect'] = array(
    'description' => 'Basic cart order registration table.',
    'fields' => array(
      'oid' => array(
        'description' => 'The primary identifier for an order.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'id' => array(
        'description' => 'Order node.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'entitytype' => array(
        'description' => 'Entity Type',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => 'node',
      ),
      'quantity' => array(
        'description' => 'Order node quantity.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'oid',
      'id',
    ),
  );
  $schema['basic_cart_cart'] = array(
    'description' => 'Basic cart store table.',
    'fields' => array(
      'uid' => array(
        'description' => 'The primary identifier for an order.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'id' => array(
        'description' => 'EntityId',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'entitytype' => array(
        'description' => 'Entity Type',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => 'node',
      ),
      'quantity' => array(
        'description' => 'Order node quantity.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'uid',
      'id',
    ),
  );
  return $schema;
}