You are here

function notify_schema in Notify 8

Same name and namespace in other branches
  1. 6 notify.install \notify_schema()
  2. 7 notify.install \notify_schema()
  3. 2.0.x notify.install \notify_schema()
  4. 1.0.x notify.install \notify_schema()

Implements hook_schema().

File

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

Code

function notify_schema() {
  $schema['notify'] = array(
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => '10',
      ),
      'status' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => '2',
      ),
      'node' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => '2',
      ),
      'comment' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => '2',
      ),
      'attempts' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => '4',
      ),
      'teasers' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => '4',
      ),
    ),
    'primary key' => array(
      'uid',
    ),
  );
  $schema['notify_subscriptions'] = array(
    'description' => 'Stores custom subscriptions to content types.',
    'fields' => array(
      'id' => array(
        'description' => 'primary key',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'description' => '{users}.uid that subscribes to this type.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        'description' => '{node}.nid of the subscribed node.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
      ),
      'type' => array(
        'description' => 'machine-readable name of the subscribed type',
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  $schema['notify_unpublished_queue'] = array(
    'description' => 'Stores list of unpublished contents to determine what content have been published since last notification.',
    'fields' => array(
      'id' => array(
        'description' => 'primary key',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'cid' => array(
        'description' => '{comment}.cid of the unpublished comment, or 0 if it is a node.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'nid' => array(
        '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' => array(
      'id',
    ),
  );
  return $schema;
}