You are here

function language_hierarchy_schema in Language Hierarchy 8

Same name and namespace in other branches
  1. 2.x language_hierarchy.install \language_hierarchy_schema()

Implements hook_schema().

File

./language_hierarchy.install, line 18
Installation/Upgrade functions for Language hierarchy module.

Code

function language_hierarchy_schema() {
  $schema = [];
  $schema['language_hierarchy_priority'] = [
    'description' => 'Holds relative priorities for all langcodes, with respect to the global hierarchy of language fallbacks.',
    'fields' => [
      'langcode' => [
        'description' => 'An entity langcode.',
        'type' => 'varchar_ascii',
        'length' => 12,
        'not null' => TRUE,
        'default' => '',
      ],
      'priority' => [
        'description' => 'The higher the value, the more relevant the langcode. For any child language, this will be its depth. Otherwise it will be the weight of the language.',
        'type' => 'int',
        'size' => 'small',
        'not null' => TRUE,
        'default' => 0,
      ],
    ],
    'primary key' => [
      'langcode',
    ],
  ];
  return $schema;
}