You are here

function node_expire_schema in Node expire 8

Same name and namespace in other branches
  1. 6.2 node_expire.install \node_expire_schema()
  2. 6 node_expire.install \node_expire_schema()
  3. 7.2 node_expire.install \node_expire_schema()
  4. 7 node_expire.install \node_expire_schema()

Implements hook_schema().

File

./node_expire.install, line 22
Install, uninstall and update the module.

Code

function node_expire_schema() {
  $schema['node_expire'] = array(
    'description' => 'Alerts administrators of possibly outdated materials, and optionally unpublishes them.',
    'fields' => array(
      'nid' => array(
        'description' => 'Node ID from {node}.nid.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'expire' => array(
        'type' => 'int',
        'default' => 0,
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'expired' => array(
        'type' => 'int',
        'size' => 'tiny',
        'default' => 0,
        'not null' => TRUE,
      ),
      'lastnotify' => array(
        'type' => 'int',
        'default' => 0,
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'nid',
    ),
    'indexes' => array(
      'expire_expired_lastnotify' => array(
        'expire',
        'expired',
        'lastnotify',
      ),
    ),
  );
  return $schema;
}