function nodequeue_schema in Nodequeue 7.3
Same name and namespace in other branches
- 6.2 nodequeue.install \nodequeue_schema()
- 7.2 nodequeue.install \nodequeue_schema()
Implements hook_schema().
File
- ./
nodequeue.install, line 11 - Install, update and uninstall functions for the nodequeue module.
Code
function nodequeue_schema() {
$schema['nodequeue_queue'] = array(
'description' => 'Base table for queues, storing global information for each queue',
'fields' => array(
'name' => array(
'description' => 'The machine name for the queue.',
'type' => 'varchar',
'length' => 128,
),
'title' => array(
'description' => 'Title of a queue.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'subqueue_title' => array(
'description' => 'Title of a subqueue.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
),
'size' => array(
'description' => 'How many nodes this queue will hold',
'type' => 'int',
'default' => 0,
),
'link' => array(
'description' => 'The link text to show under a node to add it to the queue.',
'type' => 'varchar',
'length' => 40,
),
'link_remove' => array(
'description' => 'The link text to show under a node to remove it from the queue.',
'type' => 'varchar',
'length' => 40,
),
'owner' => array(
'description' => '',
'type' => 'varchar',
'length' => 255,
),
'show_in_ui' => array(
'description' => '',
'type' => 'int',
'size' => 'tiny',
'default' => 1,
),
'show_in_tab' => array(
'description' => '',
'type' => 'int',
'size' => 'tiny',
'default' => 1,
),
'show_in_links' => array(
'description' => '',
'type' => 'int',
'size' => 'tiny',
'default' => 1,
),
'reference' => array(
'description' => '',
'type' => 'varchar',
'length' => 255,
'default' => '0',
),
'reverse' => array(
'description' => '',
'type' => 'int',
'size' => 'tiny',
'default' => 0,
),
'i18n' => array(
'description' => '',
'type' => 'int',
'size' => 'tiny',
'default' => 1,
),
),
// fields
'primary key' => array(
'name',
),
);
// nodequeue_queue.
$schema['nodequeue_roles'] = array(
'description' => 'Defines the roles which are allowed to use a particular nodequeue.',
'fields' => array(
'name' => array(
'description' => 'The machine name for the queue.',
'type' => 'varchar',
'length' => 128,
),
'rid' => array(
'description' => 'Primary key for roles',
'type' => 'int',
'size' => 'big',
'unsigned' => TRUE,
'not null' => TRUE,
),
),
// fields
'indexes' => array(
'name' => array(
'name',
),
'rid' => array(
'rid',
),
),
);
// nodequeue_roles
$schema['nodequeue_types'] = array(
'description' => 'Defines the node types which are allowed in each queue',
'fields' => array(
'name' => array(
'description' => 'The machine name for the queue.',
'type' => 'varchar',
'length' => 128,
),
'type' => array(
'description' => 'Node Type',
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
),
),
// fields
'indexes' => array(
'name' => array(
'name',
),
'type' => array(
'type',
),
),
);
// nodequeue_types
// Subqueues are minor queues that inherit all of the properties of
// the parent queue. A parent queue must have at least 1 subqueue
// to do anything. Reference is for the use of whatever is creating
// the subqueues in order to link it to some other ID easily.
$schema['nodequeue_subqueue'] = array(
'description' => 'Subqueues are minor queues that inherit all of the properties of the parent queue. A parent queue must have at least 1 subqueue to do anything. Reference is for the use of whatever is creating the subqueues in order to link it to some other ID easily.',
'fields' => array(
'sqid' => array(
'description' => 'Subqueue identifier',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'name' => array(
'description' => 'The machine name for the queue.',
'type' => 'varchar',
'length' => 128,
),
'reference' => array(
'description' => '',
'type' => 'varchar',
'length' => 255,
'default' => '0',
'not null' => FALSE,
),
'title' => array(
'description' => '',
'type' => 'varchar',
'length' => 255,
'default' => '',
'not null' => FALSE,
),
),
// fields
'primary key' => array(
'sqid',
),
'indexes' => array(
'name' => array(
'name',
),
'reference' => array(
'reference',
),
'title' => array(
'title',
),
),
);
// nodequeue_subqueue
$schema['nodequeue_nodes'] = array(
'description' => 'Indicates which nodes are in which queues/subqueues.',
'fields' => array(
'name' => array(
'description' => 'The machine name for the queue.',
'type' => 'varchar',
'length' => 128,
),
'sqid' => array(
'description' => 'Subqueue this node is in',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
),
'nid' => array(
'description' => 'Node id in this subqueue',
'type' => 'int',
'unsigned' => TRUE,
'not null' => FALSE,
),
'position' => array(
'description' => 'The position of the node in this subqueue.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => FALSE,
),
'timestamp' => array(
'description' => "The time that the item's position in the subqueue was updated.",
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
),
),
// fields
'indexes' => array(
'sqid' => array(
'sqid',
'position',
),
'nid' => array(
'nid',
),
'name_nid' => array(
'name',
'nid',
),
),
);
// nodequeue_nodes
return $schema;
}