aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/DB/MigrationService.php
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2022-03-23 15:04:18 +0100
committerJoas Schilling <coding@schilljs.com>2022-03-25 12:44:51 +0100
commit129bae62d42d58166f51d8f7167b00b4761d60c5 (patch)
tree5697ac7f02294a3ffbfbc94474dc64ff79596b20 /lib/private/DB/MigrationService.php
parentc407bb978684f00ce07a4f168d3e380da3812028 (diff)
downloadnextcloud-server-129bae62d42d58166f51d8f7167b00b4761d60c5.tar.gz
nextcloud-server-129bae62d42d58166f51d8f7167b00b4761d60c5.zip
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 <coding@schilljs.com>
Diffstat (limited to 'lib/private/DB/MigrationService.php')
-rw-r--r--lib/private/DB/MigrationService.php4
1 files changed, 4 insertions, 0 deletions
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) {