* {@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.',