You are here

block_aria_landmark_roles.install in Block ARIA Landmark Roles 6

Install, update, and uninstall functions for the Blocks ARIA Landmark Roles module.

File

block_aria_landmark_roles.install
View source
<?php

/**
 * @file
 * Install, update, and uninstall functions for the Blocks ARIA Landmark Roles
 * module.
 */

/**
 * Implementation of hook_schema().
 *
 * Creates a new database table when the module is installed.
 */
function block_aria_landmark_roles_schema() {
  $schema['block_aria_landmark_roles'] = array(
    'description' => 'Stores ARIA landmark roles assigned to blocks',
    'fields' => array(
      'module' => array(
        'description' => 'The name of the module that generates the block',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'delta' => array(
        'description' => 'The delta value of the block',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'role' => array(
        'description' => 'The assigned ARIA landmark role',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
    ),
  );
  return $schema;
}

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

  // Create the database table.
  drupal_install_schema('block_aria_landmark_roles');
}

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

  // Delete the database table.
  drupal_uninstall_schema('block_aria_landmark_roles');
}

/**
 * Removed the primary key from the block_aria_landmark_roles table.
 */
function block_aria_landmark_roles_update_6100() {
  $ret = array();
  db_drop_primary_key($ret, 'block_aria_landmark_roles');
  return $ret;
}

/**
 * Removed the primary key from the block_aria_landmark_roles table.
 */
function block_aria_landmark_roles_update_6101() {
  $ret = array();
  $spec = array(
    'description' => 'The assigned ARIA landmark role',
    'type' => 'varchar',
    'length' => '255',
    'not null' => TRUE,
    'default' => '',
  );
  db_change_field($ret, 'block_aria_landmark_roles', 'aria_role', 'role', $spec);
  return $ret;
}

Functions

Namesort descending Description
block_aria_landmark_roles_install Implementation of hook_install().
block_aria_landmark_roles_schema Implementation of hook_schema().
block_aria_landmark_roles_uninstall Implementation of hook_uninstall().
block_aria_landmark_roles_update_6100 Removed the primary key from the block_aria_landmark_roles table.
block_aria_landmark_roles_update_6101 Removed the primary key from the block_aria_landmark_roles table.