You are here

function bat_booking_schema in Booking and Availability Management Tools for Drupal 7

Implements hook_schema().

File

modules/bat_booking/bat_booking.install, line 19
Install, update and uninstall functions for the BAT Booking module.

Code

function bat_booking_schema() {
  $schema = array();
  $schema['bat_bookings'] = array(
    'description' => 'The base table for Bookings.',
    'fields' => array(
      'booking_id' => array(
        'description' => 'Primary Key: Identifier for a Booking.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'type' => array(
        'description' => 'The {booking_type}.type of this Booking.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'language' => array(
        'description' => 'The language of the Booking.',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'label' => array(
        'description' => 'The label of the Booking - a human-readable identifier.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'created' => array(
        'description' => 'The Unix timestamp when the Booking was created.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'changed' => array(
        'description' => 'The Unix timestamp when the Booking was most recently saved.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'uid' => array(
        'description' => 'The {users}.uid that created this booking.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'status' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0x1,
        'size' => 'tiny',
        'description' => 'The exportable status of the entity.',
      ),
      'data' => array(
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'A serialized array of additional data.',
      ),
    ),
    'primary key' => array(
      'booking_id',
    ),
    'indexes' => array(
      'type' => array(
        'type',
      ),
    ),
  );
  $schema['bat_booking_types'] = array(
    'description' => 'The base table for Types.',
    'fields' => array(
      'id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Identifier for a Type.',
      ),
      'type' => array(
        'description' => 'The {type_bundle}.type of this Type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
      ),
      'label' => array(
        'description' => 'The human-readable name of this booking type.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'default_booking_label_field_name' => array(
        'type' => 'varchar',
        'not null' => FALSE,
        'length' => 32,
        'description' => 'The name of a field to use to retrieve label information.',
      ),
      'data' => array(
        'type' => 'blob',
        'not null' => FALSE,
        'size' => 'big',
        'serialize' => TRUE,
        'description' => 'A serialized array of additional data.',
      ),
      'status' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0x1,
        'size' => 'tiny',
        'description' => 'The exportable status of the entity.',
      ),
      'module' => array(
        'description' => 'The name of the providing module if the entity has been defined in code.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'unique keys' => array(
      'type' => array(
        'type',
      ),
    ),
  );
  return $schema;
}