You are here

function user_expire_schema in User Expire 7

Same name and namespace in other branches
  1. 8 user_expire.install \user_expire_schema()

Implements hook_schema().

File

./user_expire.install, line 17
Install, update and uninstall functions for the User expire module.

Code

function user_expire_schema() {
  $schema['user_expire'] = array(
    'description' => 'The tracking table for user expirations.',
    'fields' => array(
      'uid' => array(
        'description' => 'The primary identifier for a user.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'expiration' => array(
        'description' => 'The Unix timestamp when the user will be disabled.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'foreign keys' => array(
      'uid' => array(
        'table' => 'users',
        'columns' => array(
          'uid' => 'uid',
        ),
      ),
    ),
    'primary key' => array(
      'uid',
    ),
  );
  $schema['user_expire_roles'] = array(
    'description' => 'The tracking table for user expirations.',
    'fields' => array(
      'rid' => array(
        'description' => 'The primary identifier for a role.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'inactivity_period' => array(
        'description' => 'The number of seconds of inactivity allowed before expiring a user.',
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'foreign keys' => array(
      'rid' => array(
        'table' => 'role',
        'columns' => array(
          'rid' => 'rid',
        ),
      ),
    ),
    'primary key' => array(
      'rid',
    ),
  );
  return $schema;
}