diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php index 95846eff24..044af8c880 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php @@ -1361,15 +1361,12 @@ protected function createSharedTableSchema(FieldStorageDefinitionInterface $stor if (!$only_save) { // The entity schema needs to be checked because the field schema is // potentially incomplete. - // @todo Remove this in - // https://www.drupal.org/project/drupal/issues/2929120 - $entity_schema = $this->getEntitySchema($this->entityType); foreach ($schema[$table_name]['fields'] as $name => $specifier) { // Check if the field is part of the primary keys and pass along // this information when adding the field. // @see \Drupal\Core\Database\Schema::addField() $new_keys = []; - if (!empty($schema[$table_name]['primary key']) && in_array($name, $entity_schema[$table_name]['primary key'], TRUE)) { + if (!empty($schema[$table_name]['primary key']) && in_array($name, $schema[$table_name]['primary key'], TRUE)) { $new_keys = ['primary key' => $schema[$table_name]['primary key']]; } @@ -1652,7 +1649,7 @@ protected function updateSharedTableSchema(FieldStorageDefinitionInterface $stor } // Drop the original primary key, indexes and unique keys first. - $this->dropPrimaryKey($table_name, $column_names); + $this->dropPrimaryKey($table_mapping, $table_name, $schema[$table_name], $column_names); if (!empty($original_schema[$table_name]['indexes'])) { foreach ($original_schema[$table_name]['indexes'] as $name => $specifier) { diff --git a/core/modules/node/node.install b/core/modules/node/node.install index 024cc0ccb6..651928462d 100644 --- a/core/modules/node/node.install +++ b/core/modules/node/node.install @@ -259,7 +259,7 @@ function node_update_8400() { /** * Update the stored schema data of various node fields. */ -function node_update_8501() { +function node_update_8601() { $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); $field_names = [ diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 0213650f52..b38c2437c8 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -2139,7 +2139,7 @@ function system_update_8501() { /** * Update the stored schema data of ID and language fields. */ -function system_update_8501() { +function system_update_8601() { $entity_type_manager = \Drupal::entityTypeManager(); $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); /** @var \Drupal\Core\Entity\EntityLastInstalledSchemaRepositoryInterface $entity_last_installed_schema_respository */ diff --git a/core/modules/user/user.install b/core/modules/user/user.install index 625bca3211..aa0a2a4be6 100644 --- a/core/modules/user/user.install +++ b/core/modules/user/user.install @@ -102,7 +102,7 @@ function user_update_8100() { /** * Update the stored schema data of various node fields. */ -function user_update_8501() { +function user_update_8601() { $definition_update_manager = \Drupal::entityDefinitionUpdateManager(); $field_storage_definition = $definition_update_manager->getFieldStorageDefinition('name', 'user');