parent
4d7045e701
commit
a59f6818eb
@ -0,0 +1,40 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2014 Robin Appelman <icewind@owncloud.com> |
||||
* This file is licensed under the Affero General Public License version 3 or |
||||
* later. |
||||
* See the COPYING-README file. |
||||
*/ |
||||
|
||||
namespace OC\DB; |
||||
|
||||
use Doctrine\DBAL\Schema\Schema; |
||||
|
||||
class OracleMigrator extends Migrator { |
||||
/** |
||||
* @param \Doctrine\DBAL\Schema\Schema $targetSchema |
||||
* @throws \OC\DB\MigrationException |
||||
* |
||||
* Migration testing is skipped for oracle |
||||
*/ |
||||
public function checkMigrate(Schema $targetSchema) {} |
||||
|
||||
/** |
||||
* @param Schema $targetSchema |
||||
* @param \Doctrine\DBAL\Connection $connection |
||||
* @return \Doctrine\DBAL\Schema\SchemaDiff |
||||
*/ |
||||
protected function getDiff(Schema $targetSchema, \Doctrine\DBAL\Connection $connection) { |
||||
$schemaDiff = parent::getDiff($targetSchema, $connection); |
||||
|
||||
// oracle forces us to quote the identifiers |
||||
foreach ($schemaDiff->changedTables as $tableDiff) { |
||||
$tableDiff->name = $this->connection->quoteIdentifier($tableDiff->name); |
||||
foreach ($tableDiff->changedColumns as $column) { |
||||
$column->oldColumnName = $this->connection->quoteIdentifier($column->oldColumnName); |
||||
} |
||||
} |
||||
|
||||
return $schemaDiff; |
||||
} |
||||
} |
Loading…
Reference in new issue