You are here

function path_breadcrumbs_schema in Path Breadcrumbs 7.2

Same name and namespace in other branches
  1. 7.3 path_breadcrumbs.install \path_breadcrumbs_schema()
  2. 7 path_breadcrumbs.install \path_breadcrumbs_schema()

Implements hook_schema().

File

./path_breadcrumbs.install, line 23
Provides database structure for PATH BREADCRUMBS module.

Code

function path_breadcrumbs_schema() {
  $schema['path_breadcrumbs'] = array(
    'description' => 'Stores path breadcrumbs.',
    'export' => array(
      'key' => 'machine_name',
      'primary key' => 'path_id',
      'identifier' => 'path_breadcrumb',
      'default hook' => 'path_breadcrumbs_settings_info',
      'can disable' => FALSE,
      'load callback' => 'path_breadcrumbs_load_by_name',
      'load multiple callback' => 'path_breadcrumbs_load_by_name_multiple',
      'load all callback' => 'path_breadcrumbs_load_all',
      'export callback' => 'path_breadcrumbs_export',
      'list callback' => 'path_breadcrumbs_export_list',
      'api' => array(
        'owner' => 'path_breadcrumbs',
        'api' => 'path_breadcrumbs',
        'minimum_version' => 1,
        'current_version' => 1,
      ),
    ),
    'fields' => array(
      'path_id' => array(
        'description' => t("Breadcrumb's variant unique identifier"),
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
        'no export' => TRUE,
      ),
      'machine_name' => array(
        'description' => t("Breadcrumb's variant machine name"),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'name' => array(
        'description' => t("Breadcrumb's variant human-readable name"),
        'type' => 'varchar',
        'length' => 64,
        'not null' => TRUE,
      ),
      'path' => array(
        'description' => t('URL where breadcrumb should be shown'),
        'type' => 'varchar',
        'length' => 256,
        'not null' => TRUE,
      ),
      'data' => array(
        'description' => t('Serialized data of breadcrumb'),
        'type' => 'blob',
        'not null' => TRUE,
        'size' => 'big',
        'serialize' => TRUE,
        'object default' => array(),
      ),
      'weight' => array(
        'description' => t('Breadcrumb weight related to other breadcrumbs'),
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'path_id',
    ),
    'unique keys' => array(
      'machine_name' => array(
        'machine_name',
      ),
    ),
  );
  return $schema;
}