diff options
author | Côme Chilliet <91878298+come-nc@users.noreply.github.com> | 2022-03-31 11:37:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-31 11:37:43 +0200 |
commit | dd357d7f9b4f40e8d3f5cd5dfe2aa37663c049b1 (patch) | |
tree | bdab6a65b28f4bd83a47ca86a480902c4bfaeaa5 /lib/private/DB/MigrationService.php | |
parent | f5485489248d410859048b950ffb5824ae457552 (diff) | |
parent | ddfa2f221ec454447f607c5b0fd3034b5f5a2d85 (diff) | |
download | nextcloud-server-dd357d7f9b4f40e8d3f5cd5dfe2aa37663c049b1.tar.gz nextcloud-server-dd357d7f9b4f40e8d3f5cd5dfe2aa37663c049b1.zip |
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/private/DB/MigrationService.php')
-rw-r--r-- | lib/private/DB/MigrationService.php | 4 |
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) { |