You are here

function comment_notify_schema in Comment Notify 8

Same name and namespace in other branches
  1. 6 comment_notify.install \comment_notify_schema()
  2. 7 comment_notify.install \comment_notify_schema()

Implements hook_schema().

File

./comment_notify.install, line 38
Comment_notify.install.

Code

function comment_notify_schema() {
  $schema['comment_notify'] = [
    'description' => 'Stores information about which commenters on the site have subscriped to followup emails.',
    'fields' => [
      'cid' => [
        'type' => 'int',
        'unsigned' => TRUE,
        'description' => 'The comment id from {comments}.cid',
        'not null' => TRUE,
        'disp-width' => '11',
      ],
      'notify' => [
        'type' => 'int',
        'description' => 'An integer indicating the type of subscription: 0 means not subscribed, 1 means subscribed to all comments, and 2 means only subscribed to replies of this comment.',
        'size' => 'tiny',
        'not null' => TRUE,
        'disp-width' => '11',
      ],
      'notify_hash' => [
        'type' => 'varchar',
        'description' => 'A hash of unique information about the commenter.  Used for unsubscribing users.',
        'length' => '128',
        'not null' => TRUE,
        'default' => '',
      ],
      'notified' => [
        'type' => 'int',
        'description' => 'A boolean indicator for whether or not a notification for the comment has been sent: 1 means yes, 0 means no.',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
        'disp-width' => '11',
      ],
    ],
    'primary key' => [
      'cid',
    ],
    'indexes' => [
      'notify_hash' => [
        'notify_hash',
      ],
    ],
  ];
  return $schema;
}