function shortcut_schema

shortcut_schema()

Implements hook_schema().

File

modules/shortcut/shortcut.install, line 52
Install, update and uninstall functions for the shortcut module.

Code

function shortcut_schema() {
  $schema['shortcut_set'] = array(
    'description' => 'Stores information about sets of shortcuts links.',
    'fields' => array(
      'set_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
        'description' => "Primary Key: The {menu_links}.menu_name under which the set's links are stored.",
      ),
      'title' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
        'description' => 'The title of the set.',
      ),
    ),
    'primary key' => array('set_name'),
    'foreign keys' => array(
      'menu_name' => array(
        'table' => 'menu_links',
        'columns' => array('set_name' => 'menu_name'),
      ),
    ),
  );

  $schema['shortcut_set_users'] = array(
    'description' => 'Maps users to shortcut sets.',
    'fields' => array(
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The {users}.uid for this set.',
      ),
      'set_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
        'description' => "The {shortcut_set}.set_name that will be displayed for this user.",
      ),
    ),
    'primary key' => array('uid'),
    'indexes' => array(
      'set_name' => array('set_name'),
    ),
    'foreign keys' => array(
      'set_user' => array(
        'table' => 'users',
        'columns' => array('uid' => 'uid'),
      ),
      'set_name' => array(
        'table' => 'shortcut_set',
        'columns' => array('set_name' => 'set_name'),
      ),
    ),
  );

  return $schema;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!shortcut!shortcut.install/function/shortcut_schema/7.x