You are here

function user_expire_update_2 in User Expire 7

Creates the user_expire_roles table for role-based inactivity expiration.

File

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

Code

function user_expire_update_2() {
  $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',
    ),
  );
  if (!db_table_exists('user_expire_roles')) {
    db_create_table('user_expire_roles', $schema['user_expire_roles']);
  }
}