You are here

menu_fields.install in Menu Item Fields 7

Contains install/uninstall code/hooks.

File

menu_fields.install
View source
<?php

/**
 * @file
 * Contains install/uninstall code/hooks.
 */

/**
 * Implements hook_uninstall().
 */
function menu_fields_uninstall() {
  variable_del('menu_fields_menus');
}

/**
 * Implements hook_schema().
 */
function menu_fields_schema() {

  // Add a cache table for menu fields.
  $schema['cache_menu_fields'] = drupal_get_schema_unprocessed('system', 'cache');
  $schema['menu_fields'] = array(
    'fields' => array(
      'id' => array(
        'description' => 'The primary identifier.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'menu_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The unique key for menu. This is used as a block delta so length is 32.',
      ),
      'mlid' => array(
        'description' => 'The menu link id',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'id',
    ),
    'indexes' => array(
      'menu_name_mlid' => array(
        'menu_name',
        'mlid',
      ),
    ),
  );
  return $schema;
}

Functions

Namesort descending Description
menu_fields_schema Implements hook_schema().
menu_fields_uninstall Implements hook_uninstall().