You are here

role_export.install in Role Export 7

Same filename and directory in other branches
  1. 6 role_export.install

Install, Uninstall, Schema and Update functions for role_export

File

role_export.install
View source
<?php

/**
 * @file
 * Install, Uninstall, Schema and Update functions for role_export
 */

/**
 * Implements hook_schema_alter().
 */
function role_export_schema_alter(&$schema) {

  // Add machine_name field to the 'role' table.
  $schema['role']['fields']['machine_name'] = array(
    'description' => 'The machine name assigned by the user during creation of the role.',
    'type' => 'varchar',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
  );
}

/**
 * Implements hook_install().
 */
function role_export_install() {
  db_add_field('role', 'machine_name', array(
    'description' => 'The machine name assigned by the user during creation of the role.',
    'type' => 'varchar',
    'length' => 255,
    'not null' => TRUE,
    'default' => '',
  ));
}

/**
 * Implements hook_uninstall().
 */
function role_export_uninstall() {
  db_drop_field('role', 'machine_name');
}