You are here

notify.install in Notify 8

Install, update and uninstall functions for the notify module.

File

notify.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the notify module.
 */

/**
 * Implements hook_schema().
 */
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;
}

Functions

Namesort descending Description
notify_schema Implements hook_schema().