From 2ab8268128f13520874c15ef5e3bf1e4dc386cb0 Mon Sep 17 00:00:00 2001 From: Christoph Wurst Date: Mon, 19 Apr 2021 13:05:34 +0200 Subject: [PATCH] Do not check Oracle column constraints in unrelated migrations Signed-off-by: Christoph Wurst --- lib/private/DB/MigrationService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index ee64b45be6..44b6bfa288 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -587,12 +587,12 @@ class MigrationService { throw new \InvalidArgumentException('Column name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.'); } - if ($thing->getNotnull() && $thing->getDefault() === '' + if ((!$sourceTable instanceof Table || !$sourceTable->hasColumn($thing->getName())) && $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) { + 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".'); } }