You are here

function taxonomy_menu_schema in Taxonomy menu 8

Same name and namespace in other branches
  1. 6.3 taxonomy_menu.install \taxonomy_menu_schema()
  2. 6.2 taxonomy_menu.install \taxonomy_menu_schema()
  3. 7.2 taxonomy_menu.install \taxonomy_menu_schema()
  4. 7 taxonomy_menu.install \taxonomy_menu_schema()

Implements hook_schema().

File

./taxonomy_menu.install, line 24
Install and uninstall all required databases. Also do incremental database updates.

Code

function taxonomy_menu_schema() {
  $schema['taxonomy_menu'] = array(
    'description' => 'Links a taxonomy term to a menu item.',
    'fields' => array(
      'mlid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The taxonomy terms {menu_link}.mlid.',
      ),
      'tid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'Tid that is linked to the mlid.',
      ),
      'vid' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'Vid for the tid.',
      ),
      'language' => array(
        'description' => 'Language code, e.g. ’de’ or ’en-US’.',
        'type' => 'varchar',
        'length' => 12,
        'not null' => TRUE,
        'default' => Language::LANGCODE_NOT_SPECIFIED,
      ),
    ),
    'primary key' => array(
      'mlid',
      'tid',
      'language',
    ),
    'indexes' => array(
      'vid' => array(
        'vid',
      ),
    ),
  );
  return $schema;
}