function notify_schema in Notify 2.0.x
Same name and namespace in other branches
- 8 notify.install \notify_schema()
- 6 notify.install \notify_schema()
- 7 notify.install \notify_schema()
- 1.0.x notify.install \notify_schema()
Implements hook_schema().
File
- ./
notify.install, line 22 - Install, update and uninstall functions for the notify module.
Code
function notify_schema() {
$schema['notify'] = [
'fields' => [
'uid' => [
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'disp-width' => '10',
],
'status' => [
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
'disp-width' => '2',
],
'node' => [
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
'disp-width' => '2',
],
'comment' => [
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
'disp-width' => '2',
],
'attempts' => [
'type' => 'int',
'size' => 'tiny',
'not null' => TRUE,
'default' => 0,
'disp-width' => '4',
],
],
'primary key' => [
'uid',
],
];
$schema['notify_subscriptions'] = [
'description' => 'Stores custom subscriptions to node types.',
'fields' => [
'id' => [
'description' => 'primary key',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
],
'uid' => [
'description' => '{users}.uid that subscribes to this type.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
],
'nid' => [
'description' => '{node}.nid of the subscribed node.',
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
],
'type' => [
'description' => 'machine-readable name of the subscribed type',
'type' => 'varchar',
'length' => 32,
'not null' => TRUE,
'default' => '',
],
],
'primary key' => [
'id',
],
];
$schema['notify_unpublished_queue'] = [
'description' => 'Stores list of unpublished contents to determine what content have been published since last notification.',
'fields' => [
'id' => [
'description' => 'primary key',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
],
'cid' => [
'description' => '{comment}.cid of the unpublished comment, or 0 if it is a node.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
],
'nid' => [
'description' => '{node}.nid of the uinpublished node, or {node}.nid to the node which the comment is a reply.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
],
],
'primary key' => [
'id',
],
];
return $schema;
}