You are here

function regcode_roles_schema in Registration codes 7

Same name and namespace in other branches
  1. 6.2 regcode_roles/regcode_roles.install \regcode_roles_schema()
  2. 6 regcode_roles/regcode_roles.install \regcode_roles_schema()
  3. 7.2 regcode_roles/regcode_roles.install \regcode_roles_schema()

Implements hook_schema().

File

regcode_roles/regcode_roles.install, line 42
Install, update and uninstall functions for the regcode_roles module.

Code

function regcode_roles_schema() {
  $schema['regcode_roles'] = array(
    'description' => 'Store registration role rules',
    'fields' => array(
      'id' => array(
        'description' => 'ID',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'term_id' => array(
        'description' => 'Term ID',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'role_id' => array(
        'description' => 'Role ID',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'expire_date' => array(
        'description' => 'Expiration date',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'expire_duration' => array(
        'description' => 'Expiration duration',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}