X-Git-Url: http://www.aleph1.co.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=web%2Fcore%2Fmodules%2Ftaxonomy%2Fsrc%2FTermStorageSchema.php;fp=web%2Fcore%2Fmodules%2Ftaxonomy%2Fsrc%2FTermStorageSchema.php;h=4892b52ccb56399c2a7766fadee63131490fb878;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=5bcb088db455855868046019c6950506102e0183;hpb=74df008bdbb3a11eeea356744f39b802369bda3c;p=yaffs-website diff --git a/web/core/modules/taxonomy/src/TermStorageSchema.php b/web/core/modules/taxonomy/src/TermStorageSchema.php index 5bcb088db..4892b52cc 100644 --- a/web/core/modules/taxonomy/src/TermStorageSchema.php +++ b/web/core/modules/taxonomy/src/TermStorageSchema.php @@ -15,42 +15,14 @@ class TermStorageSchema extends SqlContentEntityStorageSchema { * {@inheritdoc} */ protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $reset = FALSE) { - $schema = parent::getEntitySchema($entity_type, $reset = FALSE); + $schema = parent::getEntitySchema($entity_type, $reset); - $schema['taxonomy_term_field_data']['indexes'] += [ - 'taxonomy_term__tree' => ['vid', 'weight', 'name'], - 'taxonomy_term__vid_name' => ['vid', 'name'], - ]; - - $schema['taxonomy_term_hierarchy'] = [ - 'description' => 'Stores the hierarchical relationship between terms.', - 'fields' => [ - 'tid' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - 'description' => 'Primary Key: The {taxonomy_term_data}.tid of the term.', - ], - 'parent' => [ - 'type' => 'int', - 'unsigned' => TRUE, - 'not null' => TRUE, - 'default' => 0, - 'description' => "Primary Key: The {taxonomy_term_data}.tid of the term's parent. 0 indicates no parent.", - ], - ], - 'indexes' => [ - 'parent' => ['parent'], - ], - 'foreign keys' => [ - 'taxonomy_term_data' => [ - 'table' => 'taxonomy_term_data', - 'columns' => ['tid' => 'tid'], - ], - ], - 'primary key' => ['tid', 'parent'], - ]; + if ($data_table = $this->storage->getDataTable()) { + $schema[$data_table]['indexes'] += [ + 'taxonomy_term__tree' => ['vid', 'weight', 'name'], + 'taxonomy_term__vid_name' => ['vid', 'name'], + ]; + } $schema['taxonomy_index'] = [ 'description' => 'Maintains denormalized information about node/term relationships.',