Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / taxonomy / src / TermStorageSchema.php
index 5bcb088db455855868046019c6950506102e0183..4892b52ccb56399c2a7766fadee63131490fb878 100644 (file)
@@ -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.',