Merge pull request #22652 from nextcloud/backport/22643/stable19

[stable19] Fix installing on Oracle
This commit is contained in:
Morris Jobke 2020-09-09 15:10:39 +02:00 committed by GitHub
commit b7bcf5c019
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -59,7 +59,9 @@ class Version18000Date20190920085628 extends SimpleMigrationStep {
$table->addColumn('displayname', Type::STRING, [ $table->addColumn('displayname', Type::STRING, [
'notnull' => true, 'notnull' => true,
'length' => 255, 'length' => 255,
'default' => '', // Will be overwritten in postSchemaChange, but Oracle can not save
// empty strings in notnull columns
'default' => 'name',
]); ]);
} }

View File

@ -513,6 +513,11 @@ class MigrationService {
if ((!$sourceTable instanceof Table || !$sourceTable->hasColumn($thing->getName())) && \strlen($thing->getName()) > 30) { if ((!$sourceTable instanceof Table || !$sourceTable->hasColumn($thing->getName())) && \strlen($thing->getName()) > 30) {
throw new \InvalidArgumentException('Column name "' . $table->getName() . '"."' . $thing->getName() . '" is too long.'); 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) { foreach ($table->getIndexes() as $thing) {