You are here

function cas_schema in CAS 6.3

Same name and namespace in other branches
  1. 8 cas.install \cas_schema()
  2. 7 cas.install \cas_schema()
  3. 2.x cas.install \cas_schema()

Implementation of hook_schema().

File

./cas.install, line 11
Installation hooks for the CAS module.

Code

function cas_schema() {
  $schema = array();
  $schema['cas_login_data'] = array(
    'description' => 'Stores CAS session information.',
    'fields' => array(
      'cas_session_id' => array(
        'description' => 'CAS session ID',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'uid' => array(
        'description' => 'The {users}.uid associated with the CAS session.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'cas_session_id',
    ),
  );
  $schema['cas_user'] = array(
    'description' => 'Stores CAS authentication mapping.',
    'fields' => array(
      'aid' => array(
        'description' => 'Primary Key: Unique authmap ID.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => "User's {users}.uid.",
      ),
      'cas_name' => array(
        'type' => 'varchar',
        'length' => 128,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Unique authentication name.',
      ),
    ),
    'unique keys' => array(
      'cas_name' => array(
        'cas_name',
      ),
    ),
    'indexes' => array(
      'cas_user' => array(
        'uid',
      ),
    ),
    'primary key' => array(
      'aid',
    ),
  );
  return $schema;
}