Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion core/Migrations/Version18000Date20190920085628.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
$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',
]);
}

Expand Down
5 changes: 5 additions & 0 deletions lib/private/DB/MigrationService.php
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,11 @@ public function ensureOracleIdentifierLengthLimit(Schema $sourceSchema, Schema $
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) {
Expand Down