From 82c33be744b1e9d85c780bce277c783c6d38e7bf Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 7 Apr 2022 12:42:52 +0200 Subject: [PATCH] Fix typos and empty tabs Signed-off-by: Joas Schilling --- lib/private/DB/MigrationService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 2b129edca26..fb7b6b7472f 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -582,17 +582,17 @@ class MigrationService { } foreach ($table->getColumns() as $thing) { - // If the table doesn't exists OR if the column doesn't exists in the table + // If the table doesn't exist OR if the column doesn't exist in the table if (!$sourceTable instanceof Table || !$sourceTable->hasColumn($thing->getName())) { if (\strlen($thing->getName()) > 30) { throw new \InvalidArgumentException('Column name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.'); } - + if ($thing->getNotnull() && $thing->getDefault() === '' && $sourceTable instanceof Table && !$sourceTable->hasColumn($thing->getName())) { throw new \InvalidArgumentException('Column "' . $table->getName() . '"."' . $thing->getName() . '" is NotNull, but has empty string or null as default.'); } - + if ($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".'); } @@ -601,7 +601,7 @@ class MigrationService { } else { $sourceColumn = $sourceTable->getColumn($thing->getName()); } - + // If the column was just created OR the length changed OR the type changed // we will NOT detect invalid length if the column is not modified if (($sourceColumn === null || $sourceColumn->getLength() !== $thing->getLength() || $sourceColumn->getType()->getName() !== Types::STRING) -- 2.39.5