Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorCôme Chilliet <91878298+come-nc@users.noreply.github.com>2022-03-31 12:37:43 +0300
committerGitHub <noreply@github.com>2022-03-31 12:37:43 +0300
commitdd357d7f9b4f40e8d3f5cd5dfe2aa37663c049b1 (patch)
treebdab6a65b28f4bd83a47ca86a480902c4bfaeaa5 /lib
parentf5485489248d410859048b950ffb5824ae457552 (diff)
parentddfa2f221ec454447f607c5b0fd3034b5f5a2d85 (diff)
Merge pull request #31679 from nextcloud/bugfix/noid/ensure-string-columns-to-be-maximum-of-4000
Ensure string column limit of 4.000 characters
Diffstat (limited to 'lib')
-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 a0f905115cc..046e3a4924b 100644
--- a/lib/private/DB/MigrationService.php
+++ b/lib/private/DB/MigrationService.php
@@ -595,6 +595,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) {