function cas_schema in CAS 7
Same name and namespace in other branches
- 8 cas.install \cas_schema()
- 6.3 cas.install \cas_schema()
- 2.x cas.install \cas_schema()
Implements 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,
),
'created' => array(
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'description' => 'Timestamp when this record was created.',
),
),
'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',
),
'foreign keys' => array(
'user' => array(
'table' => 'users',
'columns' => array(
'uid' => 'uid',
),
),
),
);
return $schema;
}