diff --git a/core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php b/core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php index a2a6b81..a9b86b9 100644 --- a/core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php +++ b/core/modules/system/src/Tests/Entity/EntityDefinitionUpdateTest.php @@ -798,7 +798,7 @@ public function testBaseFieldEntityKeyUpdateWithExistingData() { } /** - * Check that field schema is are correctly handled with long-named fields. + * Check that field schema is correctly handled with long-named fields. */ function testLongNameFieldIndexes() { $this->addLongNameBaseField(); diff --git a/core/modules/system/system.install b/core/modules/system/system.install index 34ef59d..69044a1 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -1847,60 +1847,3 @@ function system_update_8013() { /** * @} End of "addtogroup updates-8.0.0-beta". */ - -/** - * @addtogroup updates-8.0.0-rc - * @{ - */ - -/** - * Make sure SQL entity schema data has no incorrect value. - */ -function system_update_8014() { - $key_value = \Drupal::keyValue('entity.storage_schema.sql'); - $schema_data = $key_value->getAll(); - ksort($schema_data); - - // Collect entity and field schema data, they will be used in the subsequent - // loop. - $all_entity_schema_data = []; - $all_field_schema_data = []; - foreach ($schema_data as $key => $value) { - list($entity_type_id, $sub_key) = explode('.', $key, 2); - if ($sub_key == 'entity_schema_data') { - $all_entity_schema_data[$entity_type_id] = $value; - } - else { - list($prefix, $field_name) = explode('.', $sub_key, 2); - if ($prefix == 'field_schema_data') { - $all_field_schema_data[$entity_type_id][$field_name] = $value; - } - else { - // This is not supposed to happen. - \Drupal::logger('update')->error(t('Unexpected SQL storage schema key: @key', ['@key' => $sub_key])); - } - } - } - - // Make sure no field schema data item is also stored in the entity schema - // data. - $schema_keys = ['indexes', 'unique keys']; - foreach ($all_entity_schema_data as $entity_type_id => $entity_schema_data) { - foreach ($all_field_schema_data[$entity_type_id] as $field_name => $field_schema_data) { - foreach ($field_schema_data as $table_name => $table_field_schema_data) { - foreach ($schema_keys as $schema_key) { - if (!empty($entity_schema_data[$table_name][$schema_key]) && !empty($table_field_schema_data[$schema_key])) { - $entity_schema_data[$table_name][$schema_key] = array_diff_key($entity_schema_data[$table_name][$schema_key], $table_field_schema_data[$schema_key]); - } - } - } - $key_value->set($entity_type_id . '.entity_schema_data', $entity_schema_data); - } - } -} - -/** - * @} End of "addtogroup updates-8.0.0-rc". - */ - -