You are here

regcode_roles.install in Registration codes 6

File

regcode_roles/regcode_roles.install
View source
<?php

/**
 * Implementation of hook_uninstall()
 */
function regcode_roles_uninstall() {
  drupal_uninstall_schema('regcode_roles');
}

/**
 * Implementation of hook_install()
 */
function regcode_roles_install() {
  drupal_install_schema('regcode_roles');
}

/**
 * Implementation of hook_schema()
 */
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;
}

Functions

Namesort descending Description
regcode_roles_install Implementation of hook_install()
regcode_roles_schema Implementation of hook_schema()
regcode_roles_uninstall Implementation of hook_uninstall()