aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2021-04-20 20:49:06 +0200
committerGitHub <noreply@github.com>2021-04-20 20:49:06 +0200
commit46872e392183215a2bcac2e7e80937ae58e4b4ab (patch)
tree60559fac96c0660e957bc9ed443ad1dd42884f95
parentf31d24dd7a076b6b343bf74e2a9e55497fb3a9d2 (diff)
parent2ab8268128f13520874c15ef5e3bf1e4dc386cb0 (diff)
downloadnextcloud-server-46872e392183215a2bcac2e7e80937ae58e4b4ab.tar.gz
nextcloud-server-46872e392183215a2bcac2e7e80937ae58e4b4ab.zip
Merge pull request #26617 from nextcloud/fix/oracle-column-check-unrelated-migrations
Do not check Oracle column constraints in unrelated migrations
-rw-r--r--lib/private/DB/MigrationService.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php
index ee64b45be64..44b6bfa2888 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".');
}
}