summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-09-09 15:10:39 +0200
committerGitHub <noreply@github.com>2020-09-09 15:10:39 +0200
commitb7bcf5c019486506c71da308846a488020a3c4ad (patch)
treefb4757c5e37d2e19710eb6e392ff116da8c7a466
parent969da6cca6c292e193ca45337e57482c654d55eb (diff)
parent1031170f35dea164c0b06020376572cb4ec337dc (diff)
downloadnextcloud-server-b7bcf5c019486506c71da308846a488020a3c4ad.tar.gz
nextcloud-server-b7bcf5c019486506c71da308846a488020a3c4ad.zip
Merge pull request #22652 from nextcloud/backport/22643/stable19
[stable19] Fix installing on Oracle
-rw-r--r--core/Migrations/Version18000Date20190920085628.php4
-rw-r--r--lib/private/DB/MigrationService.php5
2 files changed, 8 insertions, 1 deletions
diff --git a/core/Migrations/Version18000Date20190920085628.php b/core/Migrations/Version18000Date20190920085628.php
index a5ade011ccd..1d256a90751 100644
--- a/core/Migrations/Version18000Date20190920085628.php
+++ b/core/Migrations/Version18000Date20190920085628.php
@@ -59,7 +59,9 @@ class Version18000Date20190920085628 extends SimpleMigrationStep {
$table->addColumn('displayname', Type::STRING, [
'notnull' => true,
'length' => 255,
- 'default' => '',
+ // Will be overwritten in postSchemaChange, but Oracle can not save
+ // empty strings in notnull columns
+ 'default' => 'name',
]);
}
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php
index 6685c1917f5..b30d3eb8a09 100644
--- a/lib/private/DB/MigrationService.php
+++ b/lib/private/DB/MigrationService.php
@@ -513,6 +513,11 @@ class MigrationService {
if ((!$sourceTable instanceof Table || !$sourceTable->hasColumn($thing->getName())) && \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 name "' . $table->getName() . '"."' . $thing->getName() . '" is NotNull, but has empty string or null as default.');
+ }
}
foreach ($table->getIndexes() as $thing) {