diff --git a/application/Espo/Core/Utils/Database/Orm/Converter.php b/application/Espo/Core/Utils/Database/Orm/Converter.php index 6193f3c696..95fff1c277 100644 --- a/application/Espo/Core/Utils/Database/Orm/Converter.php +++ b/application/Espo/Core/Utils/Database/Orm/Converter.php @@ -90,9 +90,11 @@ class Converter /** @var array */ private $idParams = [ 'dbType' => Types::STRING, - 'len' => 24, // @todo Make configurable. + 'len' => self::DEFAULT_ID_LENGTH, ]; + private const DEFAULT_ID_LENGTH = 24; + /** * Permitted entityDefs parameters which will be copied to ormMetadata. * @@ -116,6 +118,9 @@ class Converter $platform = $configDataProvider->getPlatform(); $this->indexHelper = $indexHelperFactory->create($platform); + + $this->idParams['len'] = $this->metadata->get(['app', 'recordId', 'length']) ?? + self::DEFAULT_ID_LENGTH; } /** diff --git a/application/Espo/Resources/metadata/app/metadata.json b/application/Espo/Resources/metadata/app/metadata.json index c36516094c..fd5df5b648 100644 --- a/application/Espo/Resources/metadata/app/metadata.json +++ b/application/Espo/Resources/metadata/app/metadata.json @@ -32,6 +32,7 @@ ["app", "hook"], ["app", "api"], ["app", "databasePlatforms"], + ["app", "recordId"], ["selectDefs"], ["recordDefs"], ["pdfDefs"], diff --git a/application/Espo/Resources/metadata/app/recordId.json b/application/Espo/Resources/metadata/app/recordId.json new file mode 100644 index 0000000000..c4884c5925 --- /dev/null +++ b/application/Espo/Resources/metadata/app/recordId.json @@ -0,0 +1,3 @@ +{ + "length": 24 +}