You are here

function power_menu_schema in Power Menu 7

Same name and namespace in other branches
  1. 6 power_menu.install \power_menu_schema()
  2. 7.2 power_menu.install \power_menu_schema()

Implements hook_schema().

File

./power_menu.install, line 26
just containing the stuff for install and uninstall

Code

function power_menu_schema() {
  $schema['power_menu'] = array(
    'description' => 'Save the relation between menu and taxonomy term',
    'fields' => array(
      'mid' => array(
        'description' => 'Just a key',
        'type' => 'varchar',
        'length' => 40,
        'not null' => TRUE,
      ),
      'mlid' => array(
        'description' => 'Menu item id',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'tid' => array(
        'description' => 'Termid',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'nodetype' => array(
        'description' => 'Nodetype',
        'type' => 'varchar',
        'length' => 50,
        'not null' => FALSE,
      ),
      'path' => array(
        'description' => 'Path, this is redundant, but better performance',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
      ),
      'menu_name' => array(
        'description' => 'The menu which was selected',
        'type' => 'varchar',
        'length' => 100,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'mid',
    ),
    'indexes' => array(
      'tid' => array(
        'tid',
      ),
      'path' => array(
        'path',
      ),
      'nodetype' => array(
        'nodetype',
      ),
      'menu_name' => array(
        'menu_name',
      ),
    ),
  );
  $schema['power_menu_properties'] = array(
    'fields' => array(
      'mlid' => array(
        'description' => 'Menu item id',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'property_name' => array(
        'description' => 'Name of the property',
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'value' => array(
        'description' => 'The value of the property',
        'type' => 'text',
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'mlid',
      'property_name',
    ),
  );
  return $schema;
}