From 129bae62d42d58166f51d8f7167b00b4761d60c5 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 23 Mar 2022 15:04:18 +0100 Subject: Ensure string column limit of 4.000 characters https://docs.oracle.com/en/database/oracle/oracle-database/19/refrn/datatype-limits.html#GUID-963C79C9-9303-49FE-8F2D-C8AAF04D3095 Signed-off-by: Joas Schilling --- lib/private/DB/MigrationService.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/private/DB/MigrationService.php') diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 5e146112120..bc3168bb5a8 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -594,6 +594,10 @@ class MigrationService { if ((!$sourceTable instanceof Table || !$sourceTable->hasColumn($thing->getName())) && $thing->getNotnull() && $thing->getType()->getName() === Types::BOOLEAN) { throw new \InvalidArgumentException('Column "' . $table->getName() . '"."' . $thing->getName() . '" is type Bool and also NotNull, so it can not store "false".'); } + + if ($thing->getLength() > 4000 && $thing->getType()->getName() === Types::STRING) { + throw new \InvalidArgumentException('Column "' . $table->getName() . '"."' . $thing->getName() . '" is type String, but exceeding the 4.000 length limit.'); + } } foreach ($table->getIndexes() as $thing) { -- cgit v1.2.3