diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php index 96cea9f49db6db5e2ac52871f59d639b3abd2ce8..61da55f04ff6ec5836c103a98190a42681d41000 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php @@ -7,7 +7,6 @@ use Drupal\Core\DependencyInjection\DependencySerializationTrait; use Drupal\Core\Entity\ContentEntityTypeInterface; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Entity\EntityPublishedInterface; use Drupal\Core\Entity\EntityStorageException; use Drupal\Core\Entity\EntityTypeInterface; use Drupal\Core\Entity\Exception\FieldStorageDefinitionUpdateForbiddenException; @@ -549,24 +548,6 @@ protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $res $this->processRevisionDataTable($entity_type, $schema[$tables['revision_data_table']]); } - // Add an index for the 'published' entity key. - if (is_subclass_of($entity_type->getClass(), EntityPublishedInterface::class)) { - $published_key = $entity_type->getKey('published'); - if ($published_key && !$storage_definitions[$published_key]->hasCustomStorage()) { - $published_field_table = $table_mapping->getFieldTableName($published_key); - $id_key = $entity_type->getKey('id'); - if ($bundle_key = $entity_type->getKey('bundle')) { - $key = "{$published_key}_{$bundle_key}"; - $columns = [$published_key, $bundle_key, $id_key]; - } - else { - $key = $published_key; - $columns = [$published_key, $id_key]; - } - $schema[$published_field_table]['indexes'][$this->getEntityIndexName($entity_type, $key)] = $columns; - } - } - $this->schema[$entity_type_id] = $schema; // Restore the actual definition. diff --git a/core/modules/comment/src/Tests/Update/CommentUpdateTest.php b/core/modules/comment/src/Tests/Update/CommentUpdateTest.php index 3db9c4a67b39aa1b955310bbca04e5e6f38bce7d..1bf3bdc340931659c8d4c3db534eea6c14455bc8 100644 --- a/core/modules/comment/src/Tests/Update/CommentUpdateTest.php +++ b/core/modules/comment/src/Tests/Update/CommentUpdateTest.php @@ -66,9 +66,6 @@ public function testPublishedEntityKey() { // Check that the entity key exists and it has the correct value. $entity_type = \Drupal::entityDefinitionUpdateManager()->getEntityType('comment'); $this->assertEqual('status', $entity_type->getKey('published')); - - // Check that the {comment_field_data} table status index has been created. - $this->assertTrue(\Drupal::database()->schema()->indexExists('comment_field_data', 'comment__status_comment_type')); } } diff --git a/core/modules/node/src/NodeStorageSchema.php b/core/modules/node/src/NodeStorageSchema.php index 18d6303458afe1c66705f7af06328880b1437a61..43bd465dff7870fa23b971b072afa4794c944da8 100644 --- a/core/modules/node/src/NodeStorageSchema.php +++ b/core/modules/node/src/NodeStorageSchema.php @@ -19,6 +19,7 @@ protected function getEntitySchema(ContentEntityTypeInterface $entity_type, $res $schema['node_field_data']['indexes'] += array( 'node__frontpage' => array('promote', 'status', 'sticky', 'created'), + 'node__status_type' => array('status', 'type', 'nid'), 'node__title_type' => array('title', array('type', 4)), );