You are here

apply_for_role.install in Apply for role 6

File

apply_for_role.install
View source
<?php

/**
 * Implementation of hook_install().
 */
function apply_for_role_install() {

  // Create tables.
  drupal_install_schema('apply_for_role');
}

/**
 * Implementation of hook_schema().
 */
function apply_for_role_schema() {
  $schema['users_roles_apply'] = array(
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'rid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'approved' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'size' => 'tiny',
      ),
      'apply_date' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
      'approve_date' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'uid',
      'rid',
    ),
  );
  return $schema;
}

/**
 * Implementation of hook_uninstall().
 */
function apply_for_role_uninstall() {

  //Remove tables
  drupal_uninstall_schema('apply_for_role');

  //Remove variables
  variable_del('users_apply_roles');
  variable_del('apply_for_role_multiple');
  variable_del('apply_for_role_register');
}

Functions

Namesort descending Description
apply_for_role_install Implementation of hook_install().
apply_for_role_schema Implementation of hook_schema().
apply_for_role_uninstall Implementation of hook_uninstall().