Mercurial > hg > isophonics-drupal-site
comparison core/modules/taxonomy/src/TermStorageSchema.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children | af1871eacc83 |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
13 | 13 |
14 /** | 14 /** |
15 * {@inheritdoc} | 15 * {@inheritdoc} |
16 */ | 16 */ |
17 protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) { | 17 protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) { |
18 $schema = parent::getEntitySchema($entity_type, $reset = FALSE); | 18 $schema = parent::getEntitySchema($entity_type, $reset); |
19 | 19 |
20 $schema['taxonomy_term_field_data']['indexes'] += [ | 20 if ($data_table = $this->storage->getDataTable()) { |
21 'taxonomy_term__tree' => ['vid', 'weight', 'name'], | 21 $schema[$data_table]['indexes'] += [ |
22 'taxonomy_term__vid_name' => ['vid', 'name'], | 22 'taxonomy_term__tree' => ['vid', 'weight', 'name'], |
23 ]; | 23 'taxonomy_term__vid_name' => ['vid', 'name'], |
24 | 24 ]; |
25 $schema['taxonomy_term_hierarchy'] = [ | 25 } |
26 'description' => 'Stores the hierarchical relationship between terms.', | |
27 'fields' => [ | |
28 'tid' => [ | |
29 'type' => 'int', | |
30 'unsigned' => TRUE, | |
31 'not null' => TRUE, | |
32 'default' => 0, | |
33 'description' => 'Primary Key: The {taxonomy_term_data}.tid of the term.', | |
34 ], | |
35 'parent' => [ | |
36 'type' => 'int', | |
37 'unsigned' => TRUE, | |
38 'not null' => TRUE, | |
39 'default' => 0, | |
40 'description' => "Primary Key: The {taxonomy_term_data}.tid of the term's parent. 0 indicates no parent.", | |
41 ], | |
42 ], | |
43 'indexes' => [ | |
44 'parent' => ['parent'], | |
45 ], | |
46 'foreign keys' => [ | |
47 'taxonomy_term_data' => [ | |
48 'table' => 'taxonomy_term_data', | |
49 'columns' => ['tid' => 'tid'], | |
50 ], | |
51 ], | |
52 'primary key' => ['tid', 'parent'], | |
53 ]; | |
54 | 26 |
55 $schema['taxonomy_index'] = [ | 27 $schema['taxonomy_index'] = [ |
56 'description' => 'Maintains denormalized information about node/term relationships.', | 28 'description' => 'Maintains denormalized information about node/term relationships.', |
57 'fields' => [ | 29 'fields' => [ |
58 'nid' => [ | 30 'nid' => [ |