You are here

function role_expire_schema in Role Expire 2.x

Same name and namespace in other branches
  1. 8 role_expire.install \role_expire_schema()
  2. 6 role_expire.install \role_expire_schema()
  3. 7 role_expire.install \role_expire_schema()

Implements hook_schema().

File

./role_expire.install, line 13
Role expire install.

Code

function role_expire_schema() {
  $schema = array();
  $schema['role_expire'] = array(
    'description' => t('Expiration time for the user roles.'),
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'description' => t('User ID connected with expiration time.'),
      ),
      'rid' => array(
        'type' => 'varchar',
        'not null' => TRUE,
        'length' => 128,
        'description' => 'The role ID assigned to the user.',
      ),
      'expiry_timestamp' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => t('Role expiration timestamp.'),
      ),
    ),
    'primary key' => array(
      'uid',
      'rid',
    ),
  );

  // Moved to configuration since 8.x-1.5.

  /*$schema['role_expire_length'] = array(
      'description' => t('Length in days to assign each role by default.'),
      'fields' => array(
        'rid' => array(
          'type' => 'varchar',
          'not null' => TRUE,
          'length' => 128,
          'description' => 'The role ID assigned to the user.',
        ),
        'duration' => array(
          'type' => 'text',
          'size' => 'small',
          'not null' => TRUE,
          'description' => t('A strtotime-compatible default duration string.')
        ),
      ),
      'primary key' => array('rid'),
    );*/
  return $schema;
}