From 6140e65c6bca89ecf4d016b2fc610b6265176b82 Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Tue, 24 Jun 2014 14:07:04 +0100 Subject: [PATCH] Issue #2279363 by tstoeckler: Fixed file_managed.uri should not specify a prefixed unique key. --- core/modules/file/src/Entity/File.php | 3 ++- core/modules/file/src/FileStorage.php | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/core/modules/file/src/Entity/File.php b/core/modules/file/src/Entity/File.php index f61c49147852..cf8848bff88e 100644 --- a/core/modules/file/src/Entity/File.php +++ b/core/modules/file/src/Entity/File.php @@ -256,7 +256,8 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) { $fields['uri'] = FieldDefinition::create('uri') ->setLabel(t('URI')) - ->setDescription(t('The URI to access the file (either local or remote).')); + ->setDescription(t('The URI to access the file (either local or remote).')) + ->setSetting('max_length', 255); $fields['filemime'] = FieldDefinition::create('string') ->setLabel(t('File MIME type')) diff --git a/core/modules/file/src/FileStorage.php b/core/modules/file/src/FileStorage.php index 1ec8fbf59962..93dae425a690 100644 --- a/core/modules/file/src/FileStorage.php +++ b/core/modules/file/src/FileStorage.php @@ -46,10 +46,7 @@ public function getSchema() { 'file__changed' => array('changed'), ); $schema['file_managed']['unique keys'] += array( - // FIXME We have an index size of 255, but the max URI length is 2048 so - // this might now always work. Should we replace this with a regular - // index? - 'file__uri' => array(array('uri', 255)), + 'file__uri' => array('uri'), ); return $schema; -- GitLab