diff --git a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php index 46e96c9a88..f75afab3cf 100644 --- a/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php +++ b/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorageSchema.php @@ -2248,9 +2248,12 @@ protected function getDedicatedTableSchema(FieldStorageDefinitionInterface $stor ]; } else { + $id_settings = $id_definition->getSettings(); + $max_length = array_key_exists('max_length', $id_settings) ? $id_settings['max_length'] : 128; + $is_ascii = array_key_exists('is_ascii', $id_settings) ? $id_settings['is_ascii'] : TRUE; $id_schema = [ - 'type' => 'varchar_ascii', - 'length' => 128, + 'type' => $is_ascii ? 'varchar_ascii' : 'varchar', + 'length' => $max_length, 'not null' => TRUE, 'description' => 'The entity id this data is attached to', ]; diff --git a/core/tests/Drupal/Tests/Core/Field/TestBaseFieldDefinitionInterface.php b/core/tests/Drupal/Tests/Core/Field/TestBaseFieldDefinitionInterface.php index 953c90209f..33e055f00e 100644 --- a/core/tests/Drupal/Tests/Core/Field/TestBaseFieldDefinitionInterface.php +++ b/core/tests/Drupal/Tests/Core/Field/TestBaseFieldDefinitionInterface.php @@ -9,4 +9,7 @@ * Defines a test interface to mock entity base field definitions. */ interface TestBaseFieldDefinitionInterface extends FieldDefinitionInterface, FieldStorageDefinitionInterface { + + public function getSettings(): array; + }