You are here

function blocked_ips_expire_schema in Blocked IPs Expire 7

Implements hook_schema().

File

./blocked_ips_expire.install, line 39
Install, update, and uninstall functions for the blocked_ips_expire module.

Code

function blocked_ips_expire_schema() {
  $schema = array();

  // A table that can be joined onto blocked_ips to add an expiry date to that
  // entry.
  $schema['blocked_ips_expire'] = array(
    'description' => '',
    'fields' => array(
      'iid' => array(
        'description' => 'Primary Key: unique ID for IP addresses.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'expiry_date' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Timestamp for when this IP address can be unblocked.',
      ),
    ),
    'primary key' => array(
      'iid',
    ),
    'indexes' => array(
      'iid' => array(
        'iid',
      ),
    ),
    'foreign keys' => array(
      'iid' => array(
        'table' => 'blocked_ips',
        'columns' => array(
          'iid' => 'iid',
        ),
      ),
    ),
  );
  return $schema;
}