You are here

function protected_node_schema in Protected Node 7

Same name and namespace in other branches
  1. 6 protected_node.install \protected_node_schema()
  2. 1.0.x protected_node.install \protected_node_schema()

Implements hook_schema().

File

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

Code

function protected_node_schema() {
  $schema['protected_nodes'] = array(
    'description' => 'The table to store the node - password hash pairs.',
    'fields' => array(
      'nid' => array(
        'description' => 'The primary identifier for a node',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'protected_node_is_protected' => array(
        'description' => 'Whether this node is currently protected.',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
      'protected_node_passwd' => array(
        'description' => 'The sha1/sha256 hashed password for the given node.',
        'type' => 'char',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
      ),
      'protected_node_passwd_changed' => array(
        'description' => 'Date when the password was last changed',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'protected_node_show_title' => array(
        'description' => 'Whether the title of the node should also be protected.',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ),
      'protected_node_emails' => array(
        'description' => 'List of email addresses which received the last notification.',
        'type' => 'text',
        'size' => 'normal',
      ),
      'protected_node_hint' => array(
        'description' => 'A hint about the password on this node.',
        'type' => 'text',
      ),
    ),
    'indexes' => array(
      'protected_is_protected' => array(
        'protected_node_is_protected',
      ),
      'protected_passwd' => array(
        'protected_node_passwd',
      ),
    ),
    'primary key' => array(
      'nid',
    ),
  );
  return $schema;
}