You are here

regcode_roles.install in Registration codes 6.2

File

regcode_roles/regcode_roles.install
View source
<?php

/**
 * Implements hook_update_N().
 */
function regcode_roles_update_6001() {
  $sql = array();
  $schema = regcode_roles_schema();
  db_drop_table($sql, 'regcode_roles');
  db_create_table($sql, 'regcode_roles', $schema['regcode_roles']);
  return $sql;
}

/**
 * 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('Store registration role rules'),
    'fields' => array(
      'id' => array(
        'description' => t('ID'),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'term_id' => array(
        'description' => t('Term ID'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'role_id' => array(
        'description' => t('Role ID'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'expire_date' => array(
        'description' => t('Expiration date'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
      'expire_duration' => array(
        'description' => t('Expiration duration'),
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => FALSE,
      ),
    ),
    '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()
regcode_roles_update_6001 Implements hook_update_N().