You are here

function entityqueue_schema in Entityqueue 7

Implements hook_schema().

1 call to entityqueue_schema()
entityqueue_update_7001 in ./entityqueue.install
Sets variables for keeping track of field names and queue names.

File

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

Code

function entityqueue_schema() {
  $schema['entityqueue_queue'] = array(
    'description' => 'Stores global information for each queue.',
    // CTools exportability.
    'export' => array(
      'key' => 'name',
      'identifier' => 'queue',
      'primary key' => 'name',
      'object' => 'EntityQueue',
      'admin_title' => 'label',
      'default hook' => 'entityqueue_default_queues',
      'api' => array(
        'owner' => 'entityqueue',
        'api' => 'entityqueue_default',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
      'create callback' => 'entityqueue_queue_create',
      'load callback' => 'entityqueue_queue_load',
      'load multiple callback' => 'entityqueue_queue_load_multiple',
      'save callback' => 'entityqueue_queue_save',
      'delete callback' => 'entityqueue_queue_delete',
    ),
    'fields' => array(
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The machine-readable name of this queue.',
      ),
      'label' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The human-readable name of this queue.',
      ),
      'language' => array(
        'description' => 'The {languages}.language of this queue.',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => '',
      ),
      'handler' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The handler plugin that manages this queue.',
      ),
      'target_type' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The target entity type of this queue.',
      ),
      'settings' => array(
        'type' => 'blob',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
        'description' => 'Serialized settings containing the queue properties that do not warrant a dedicated column.',
      ),
    ),
    'primary key' => array(
      'name',
    ),
  );
  $schema['entityqueue_subqueue'] = array(
    'description' => 'Stores global information for each subqueue.',
    'fields' => array(
      'subqueue_id' => array(
        'type' => 'serial',
        'not null' => TRUE,
        'description' => 'Primary Key: Unique subqueue ID.',
      ),
      'queue' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The queue (bundle) of this subqueue.',
      ),
      'name' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The machine-readable name of this subqueue.',
      ),
      'label' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The human-readable name of this subqueue.',
      ),
      'language' => array(
        'description' => 'The {languages}.language of this subqueue.',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => '',
      ),
      'module' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'description' => 'The name of the module that created this subqueue.',
      ),
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
        'default' => NULL,
        'description' => 'The {users}.uid who created this subqueue.',
      ),
      'data' => array(
        'type' => 'blob',
        'size' => 'big',
        'not null' => TRUE,
        'serialize' => TRUE,
        'description' => 'Serialized data containing the subqueue properties that do not warrant a dedicated column.',
      ),
    ),
    'primary key' => array(
      'subqueue_id',
    ),
    'unique keys' => array(
      'name' => array(
        'name',
      ),
    ),
    'indexes' => array(
      'queue' => array(
        'queue',
      ),
      'module' => array(
        'module',
      ),
      'uid' => array(
        'uid',
      ),
    ),
  );
  return $schema;
}