Also fix sequences in schemachange

This commit is contained in:
Bart Visscher 2013-03-17 17:28:36 +01:00
parent 947e03aab5
commit 82f0bcce30
1 changed files with 6 additions and 0 deletions

View File

@ -53,6 +53,12 @@ class OC_DB_Schema {
$fromSchema->dropTable($table->getName()); $fromSchema->dropTable($table->getName());
} }
} }
// remove sequences we don't know about
foreach($fromSchema->getSequences() as $table) {
if (!$toSchema->hasSequence($table->getName())) {
$fromSchema->dropSequence($table->getName());
}
}
$comparator = new \Doctrine\DBAL\Schema\Comparator(); $comparator = new \Doctrine\DBAL\Schema\Comparator();
$schemaDiff = $comparator->compare($fromSchema, $toSchema); $schemaDiff = $comparator->compare($fromSchema, $toSchema);