You are here

function menu_fields_schema in Menu Item Fields 7

Implements hook_schema().

File

./menu_fields.install, line 18
Contains install/uninstall code/hooks.

Code

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;
}