From b55ab6d22a82dbd5c1f6f30b23471dfb0a6a48ab Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Wed, 29 Jun 2016 14:54:41 +0200 Subject: Various database migration fixes (#25209) * String columns with a length higher then 4000 are converted into a CLOB columns automagically - we have to respect this when migrating * Adding schema migration tests to prevent unnecessary and non-sense migration steps Fix Oracle autoincrement and unsigned handling * Fix sqlite integer type for autoincrement * Use lower case table names - fixes pg * Fix postgres with default -1 - this only affect pg 9.4 servers - 9.5 seems to work fine --- lib/private/DB/OracleMigrator.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/private/DB/OracleMigrator.php') diff --git a/lib/private/DB/OracleMigrator.php b/lib/private/DB/OracleMigrator.php index ceb89cf64d4..010f9213a1d 100644 --- a/lib/private/DB/OracleMigrator.php +++ b/lib/private/DB/OracleMigrator.php @@ -23,6 +23,7 @@ namespace OC\DB; +use Doctrine\DBAL\Schema\ColumnDiff; use Doctrine\DBAL\Schema\Schema; class OracleMigrator extends NoCheckMigrator { @@ -39,7 +40,12 @@ class OracleMigrator extends NoCheckMigrator { $tableDiff->name = $this->connection->quoteIdentifier($tableDiff->name); foreach ($tableDiff->changedColumns as $column) { $column->oldColumnName = $this->connection->quoteIdentifier($column->oldColumnName); + // auto increment is not relevant for oracle and can anyhow not be applied on change + $column->changedProperties = array_diff($column->changedProperties, ['autoincrement', 'unsigned']); } + $tableDiff->changedColumns = array_filter($tableDiff->changedColumns, function (ColumnDiff $column) { + return count($column->changedProperties) > 0; + }); } return $schemaDiff; -- cgit v1.2.3