You are here

function regcode_roles_schema in Registration codes 6

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

Implementation of hook_schema()

File

regcode_roles/regcode_roles.install, line 22

Code

function regcode_roles_schema() {
  $schema['regcode_roles'] = array(
    'description' => t('Registration code role assignment information'),
    'fields' => array(
      'id' => array(
        'description' => t('Rule ID'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'disp-width' => '11',
      ),
      'category' => array(
        'description' => t('Category of regcode used'),
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'role' => array(
        'description' => t('Role ID'),
        'type' => 'int',
        'unsigned' => TRUE,
        'disp-width' => '11',
      ),
      'expire_date' => array(
        'description' => t('Role expiration date'),
        'type' => 'int',
        'not null' => FALSE,
        'unsigned' => TRUE,
      ),
      'expire_duration' => array(
        'description' => t('Role expiration duration'),
        'type' => 'int',
        'not null' => FALSE,
        'unsigned' => TRUE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}