Commit f59df8ca authored by Benjamin Eberlei's avatar Benjamin Eberlei

DBAL-64 - Fix Platforms to use AbstractAsset::getQuotedName() in all occourances

parent 36bb5429
...@@ -672,7 +672,7 @@ abstract class AbstractPlatform ...@@ -672,7 +672,7 @@ abstract class AbstractPlatform
public function getDropTableSQL($table) public function getDropTableSQL($table)
{ {
if ($table instanceof \Doctrine\DBAL\Schema\Table) { if ($table instanceof \Doctrine\DBAL\Schema\Table) {
$table = $table->getName(); $table = $table->getQuotedName($this);
} }
return 'DROP TABLE ' . $table; return 'DROP TABLE ' . $table;
...@@ -688,7 +688,7 @@ abstract class AbstractPlatform ...@@ -688,7 +688,7 @@ abstract class AbstractPlatform
public function getDropIndexSQL($index, $table=null) public function getDropIndexSQL($index, $table=null)
{ {
if($index instanceof \Doctrine\DBAL\Schema\Index) { if($index instanceof \Doctrine\DBAL\Schema\Index) {
$index = $index->getName(); $index = $index->getQuotedName($this);
} else if(!is_string($index)) { } else if(!is_string($index)) {
throw new \InvalidArgumentException('AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); throw new \InvalidArgumentException('AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.');
} }
...@@ -706,11 +706,11 @@ abstract class AbstractPlatform ...@@ -706,11 +706,11 @@ abstract class AbstractPlatform
public function getDropConstraintSQL($constraint, $table) public function getDropConstraintSQL($constraint, $table)
{ {
if ($constraint instanceof \Doctrine\DBAL\Schema\Constraint) { if ($constraint instanceof \Doctrine\DBAL\Schema\Constraint) {
$constraint = $constraint->getName(); $constraint = $constraint->getQuotedName($this);
} }
if ($table instanceof \Doctrine\DBAL\Schema\Table) { if ($table instanceof \Doctrine\DBAL\Schema\Table) {
$table = $table->getName(); $table = $table->getQuotedName($this);
} }
return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $constraint; return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $constraint;
...@@ -724,11 +724,11 @@ abstract class AbstractPlatform ...@@ -724,11 +724,11 @@ abstract class AbstractPlatform
public function getDropForeignKeySQL($foreignKey, $table) public function getDropForeignKeySQL($foreignKey, $table)
{ {
if ($foreignKey instanceof \Doctrine\DBAL\Schema\ForeignKeyConstraint) { if ($foreignKey instanceof \Doctrine\DBAL\Schema\ForeignKeyConstraint) {
$foreignKey = $foreignKey->getName(); $foreignKey = $foreignKey->getQuotedName($this);
} }
if ($table instanceof \Doctrine\DBAL\Schema\Table) { if ($table instanceof \Doctrine\DBAL\Schema\Table) {
$table = $table->getName(); $table = $table->getQuotedName($this);
} }
return 'ALTER TABLE ' . $table . ' DROP FOREIGN KEY ' . $foreignKey; return 'ALTER TABLE ' . $table . ' DROP FOREIGN KEY ' . $foreignKey;
...@@ -752,7 +752,7 @@ abstract class AbstractPlatform ...@@ -752,7 +752,7 @@ abstract class AbstractPlatform
throw DBALException::noColumnsSpecifiedForTable($table->getName()); throw DBALException::noColumnsSpecifiedForTable($table->getName());
} }
$tableName = $table->getName(); $tableName = $table->getQuotedName($this);
$options = $table->getOptions(); $options = $table->getOptions();
$options['uniqueConstraints'] = array(); $options['uniqueConstraints'] = array();
$options['indexes'] = array(); $options['indexes'] = array();
...@@ -773,7 +773,7 @@ abstract class AbstractPlatform ...@@ -773,7 +773,7 @@ abstract class AbstractPlatform
foreach ($table->getColumns() AS $column) { foreach ($table->getColumns() AS $column) {
/* @var \Doctrine\DBAL\Schema\Column $column */ /* @var \Doctrine\DBAL\Schema\Column $column */
$columnData = array(); $columnData = array();
$columnData['name'] = $column->getName(); $columnData['name'] = $column->getQuotedName($this);
$columnData['type'] = $column->getType(); $columnData['type'] = $column->getType();
$columnData['length'] = $column->getLength(); $columnData['length'] = $column->getLength();
$columnData['notnull'] = $column->getNotNull(); $columnData['notnull'] = $column->getNotNull();
...@@ -876,10 +876,10 @@ abstract class AbstractPlatform ...@@ -876,10 +876,10 @@ abstract class AbstractPlatform
public function getCreateConstraintSQL(\Doctrine\DBAL\Schema\Constraint $constraint, $table) public function getCreateConstraintSQL(\Doctrine\DBAL\Schema\Constraint $constraint, $table)
{ {
if ($table instanceof \Doctrine\DBAL\Schema\Table) { if ($table instanceof \Doctrine\DBAL\Schema\Table) {
$table = $table->getName(); $table = $table->getQuotedName($this);
} }
$query = 'ALTER TABLE ' . $table . ' ADD CONSTRAINT ' . $constraint->getName(); $query = 'ALTER TABLE ' . $table . ' ADD CONSTRAINT ' . $constraint->getQuotedName($this);
$columns = array(); $columns = array();
foreach ($constraint->getColumns() as $column) { foreach ($constraint->getColumns() as $column) {
...@@ -923,9 +923,9 @@ abstract class AbstractPlatform ...@@ -923,9 +923,9 @@ abstract class AbstractPlatform
public function getCreateIndexSQL(Index $index, $table) public function getCreateIndexSQL(Index $index, $table)
{ {
if ($table instanceof Table) { if ($table instanceof Table) {
$table = $table->getName(); $table = $table->getQuotedName($this);
} }
$name = $index->getName(); $name = $index->getQuotedName($this);
$columns = $index->getColumns(); $columns = $index->getColumns();
if (count($columns) == 0) { if (count($columns) == 0) {
...@@ -972,7 +972,7 @@ abstract class AbstractPlatform ...@@ -972,7 +972,7 @@ abstract class AbstractPlatform
public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table) public function getCreateForeignKeySQL(ForeignKeyConstraint $foreignKey, $table)
{ {
if ($table instanceof \Doctrine\DBAL\Schema\Table) { if ($table instanceof \Doctrine\DBAL\Schema\Table) {
$table = $table->getName(); $table = $table->getQuotedName($this);
} }
$query = 'ALTER TABLE ' . $table . ' ADD ' . $this->getForeignKeyDeclarationSQL($foreignKey); $query = 'ALTER TABLE ' . $table . ' ADD ' . $this->getForeignKeyDeclarationSQL($foreignKey);
...@@ -1423,7 +1423,7 @@ abstract class AbstractPlatform ...@@ -1423,7 +1423,7 @@ abstract class AbstractPlatform
{ {
$sql = ''; $sql = '';
if (strlen($foreignKey->getName())) { if (strlen($foreignKey->getName())) {
$sql .= 'CONSTRAINT ' . $foreignKey->getName() . ' '; $sql .= 'CONSTRAINT ' . $foreignKey->getQuotedName($this) . ' ';
} }
$sql .= 'FOREIGN KEY ('; $sql .= 'FOREIGN KEY (';
......
...@@ -379,22 +379,22 @@ class DB2Platform extends AbstractPlatform ...@@ -379,22 +379,22 @@ class DB2Platform extends AbstractPlatform
$queryParts = array(); $queryParts = array();
foreach ($diff->addedColumns AS $fieldName => $column) { foreach ($diff->addedColumns AS $fieldName => $column) {
$queryParts[] = 'ADD COLUMN ' . $this->getColumnDeclarationSQL($column->getName(), $column->toArray()); $queryParts[] = 'ADD COLUMN ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
} }
foreach ($diff->removedColumns AS $column) { foreach ($diff->removedColumns AS $column) {
$queryParts[] = 'DROP COLUMN ' . $column->getName(); $queryParts[] = 'DROP COLUMN ' . $column->getQuotedName($this);
} }
foreach ($diff->changedColumns AS $columnDiff) { foreach ($diff->changedColumns AS $columnDiff) {
/* @var $columnDiff Doctrine\DBAL\Schema\ColumnDiff */ /* @var $columnDiff Doctrine\DBAL\Schema\ColumnDiff */
$column = $columnDiff->column; $column = $columnDiff->column;
$queryParts[] = 'ALTER ' . ($columnDiff->oldColumnName) . ' ' $queryParts[] = 'ALTER ' . ($columnDiff->oldColumnName) . ' '
. $this->getColumnDeclarationSQL($column->getName(), $column->toArray()); . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
} }
foreach ($diff->renamedColumns AS $oldColumnName => $column) { foreach ($diff->renamedColumns AS $oldColumnName => $column) {
$queryParts[] = 'RENAME ' . $oldColumnName . ' TO ' . $column->getName(); $queryParts[] = 'RENAME ' . $oldColumnName . ' TO ' . $column->getQuotedName($this);
} }
if (count($queryParts) > 0) { if (count($queryParts) > 0) {
......
...@@ -114,11 +114,11 @@ DROP DATABASE ' . $name . ';'; ...@@ -114,11 +114,11 @@ DROP DATABASE ' . $name . ';';
public function getDropForeignKeySQL($foreignKey, $table) public function getDropForeignKeySQL($foreignKey, $table)
{ {
if ($foreignKey instanceof \Doctrine\DBAL\Schema\ForeignKeyConstraint) { if ($foreignKey instanceof \Doctrine\DBAL\Schema\ForeignKeyConstraint) {
$foreignKey = $foreignKey->getName(); $foreignKey = $foreignKey->getQuotedName($this);
} }
if ($table instanceof \Doctrine\DBAL\Schema\Table) { if ($table instanceof \Doctrine\DBAL\Schema\Table) {
$table = $table->getName(); $table = $table->getQuotedName($this);
} }
return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey; return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey;
...@@ -131,7 +131,7 @@ DROP DATABASE ' . $name . ';'; ...@@ -131,7 +131,7 @@ DROP DATABASE ' . $name . ';';
{ {
if ($index instanceof \Doctrine\DBAL\Schema\Index) { if ($index instanceof \Doctrine\DBAL\Schema\Index) {
$index_ = $index; $index_ = $index;
$index = $index->getName(); $index = $index->getQuotedName($this);
} else if (!is_string($index)) { } else if (!is_string($index)) {
throw new \InvalidArgumentException('AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); throw new \InvalidArgumentException('AbstractPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.');
} }
...@@ -140,7 +140,7 @@ DROP DATABASE ' . $name . ';'; ...@@ -140,7 +140,7 @@ DROP DATABASE ' . $name . ';';
return 'DROP INDEX ' . $index; return 'DROP INDEX ' . $index;
} else { } else {
if ($table instanceof \Doctrine\DBAL\Schema\Table) { if ($table instanceof \Doctrine\DBAL\Schema\Table) {
$table = $table->getName(); $table = $table->getQuotedName($this);
} }
return "IF EXISTS (SELECT * FROM sysobjects WHERE name = '$index') return "IF EXISTS (SELECT * FROM sysobjects WHERE name = '$index')
...@@ -231,23 +231,23 @@ DROP DATABASE ' . $name . ';'; ...@@ -231,23 +231,23 @@ DROP DATABASE ' . $name . ';';
} }
foreach ($diff->addedColumns AS $fieldName => $column) { foreach ($diff->addedColumns AS $fieldName => $column) {
$queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getName(), $column->toArray()); $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
} }
foreach ($diff->removedColumns AS $column) { foreach ($diff->removedColumns AS $column) {
$queryParts[] = 'DROP COLUMN ' . $column->getName(); $queryParts[] = 'DROP COLUMN ' . $column->getQuotedName($this);
} }
foreach ($diff->changedColumns AS $columnDiff) { foreach ($diff->changedColumns AS $columnDiff) {
/* @var $columnDiff Doctrine\DBAL\Schema\ColumnDiff */ /* @var $columnDiff Doctrine\DBAL\Schema\ColumnDiff */
$column = $columnDiff->column; $column = $columnDiff->column;
$queryParts[] = 'CHANGE ' . ($columnDiff->oldColumnName) . ' ' $queryParts[] = 'CHANGE ' . ($columnDiff->oldColumnName) . ' '
. $this->getColumnDeclarationSQL($column->getName(), $column->toArray()); . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
} }
foreach ($diff->renamedColumns AS $oldColumnName => $column) { foreach ($diff->renamedColumns AS $oldColumnName => $column) {
$queryParts[] = 'CHANGE ' . $oldColumnName . ' ' $queryParts[] = 'CHANGE ' . $oldColumnName . ' '
. $this->getColumnDeclarationSQL($column->getName(), $column->toArray()); . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
} }
$sql = array(); $sql = array();
......
...@@ -410,23 +410,23 @@ class MySqlPlatform extends AbstractPlatform ...@@ -410,23 +410,23 @@ class MySqlPlatform extends AbstractPlatform
} }
foreach ($diff->addedColumns AS $fieldName => $column) { foreach ($diff->addedColumns AS $fieldName => $column) {
$queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getName(), $column->toArray()); $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
} }
foreach ($diff->removedColumns AS $column) { foreach ($diff->removedColumns AS $column) {
$queryParts[] = 'DROP ' . $column->getName(); $queryParts[] = 'DROP ' . $column->getQuotedName($this);
} }
foreach ($diff->changedColumns AS $columnDiff) { foreach ($diff->changedColumns AS $columnDiff) {
/* @var $columnDiff Doctrine\DBAL\Schema\ColumnDiff */ /* @var $columnDiff Doctrine\DBAL\Schema\ColumnDiff */
$column = $columnDiff->column; $column = $columnDiff->column;
$queryParts[] = 'CHANGE ' . ($columnDiff->oldColumnName) . ' ' $queryParts[] = 'CHANGE ' . ($columnDiff->oldColumnName) . ' '
. $this->getColumnDeclarationSQL($column->getName(), $column->toArray()); . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
} }
foreach ($diff->renamedColumns AS $oldColumnName => $column) { foreach ($diff->renamedColumns AS $oldColumnName => $column) {
$queryParts[] = 'CHANGE ' . $oldColumnName . ' ' $queryParts[] = 'CHANGE ' . $oldColumnName . ' '
. $this->getColumnDeclarationSQL($column->getName(), $column->toArray()); . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
} }
$sql = array(); $sql = array();
...@@ -520,13 +520,13 @@ class MySqlPlatform extends AbstractPlatform ...@@ -520,13 +520,13 @@ class MySqlPlatform extends AbstractPlatform
public function getDropIndexSQL($index, $table=null) public function getDropIndexSQL($index, $table=null)
{ {
if($index instanceof \Doctrine\DBAL\Schema\Index) { if($index instanceof \Doctrine\DBAL\Schema\Index) {
$index = $index->getName(); $index = $index->getQuotedName($this);
} else if(!is_string($index)) { } else if(!is_string($index)) {
throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.'); throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $index parameter to be string or \Doctrine\DBAL\Schema\Index.');
} }
if($table instanceof \Doctrine\DBAL\Schema\Table) { if($table instanceof \Doctrine\DBAL\Schema\Table) {
$table = $table->getName(); $table = $table->getQuotedName($this);
} else if(!is_string($table)) { } else if(!is_string($table)) {
throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); throw new \InvalidArgumentException('MysqlPlatform::getDropIndexSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.');
} }
...@@ -543,7 +543,7 @@ class MySqlPlatform extends AbstractPlatform ...@@ -543,7 +543,7 @@ class MySqlPlatform extends AbstractPlatform
public function getDropTableSQL($table) public function getDropTableSQL($table)
{ {
if ($table instanceof \Doctrine\DBAL\Schema\Table) { if ($table instanceof \Doctrine\DBAL\Schema\Table) {
$table = $table->getName(); $table = $table->getQuotedName($this);
} else if(!is_string($table)) { } else if(!is_string($table)) {
throw new \InvalidArgumentException('MysqlPlatform::getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.'); throw new \InvalidArgumentException('MysqlPlatform::getDropTableSQL() expects $table parameter to be string or \Doctrine\DBAL\Schema\Table.');
} }
......
...@@ -113,7 +113,7 @@ class OraclePlatform extends AbstractPlatform ...@@ -113,7 +113,7 @@ class OraclePlatform extends AbstractPlatform
*/ */
public function getCreateSequenceSQL(\Doctrine\DBAL\Schema\Sequence $sequence) public function getCreateSequenceSQL(\Doctrine\DBAL\Schema\Sequence $sequence)
{ {
return 'CREATE SEQUENCE ' . $sequence->getName() . return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) .
' START WITH ' . $sequence->getInitialValue() . ' START WITH ' . $sequence->getInitialValue() .
' MINVALUE ' . $sequence->getInitialValue() . ' MINVALUE ' . $sequence->getInitialValue() .
' INCREMENT BY ' . $sequence->getAllocationSize(); ' INCREMENT BY ' . $sequence->getAllocationSize();
...@@ -455,7 +455,7 @@ LEFT JOIN all_cons_columns r_cols ...@@ -455,7 +455,7 @@ LEFT JOIN all_cons_columns r_cols
public function getDropSequenceSQL($sequence) public function getDropSequenceSQL($sequence)
{ {
if ($sequence instanceof \Doctrine\DBAL\Schema\Sequence) { if ($sequence instanceof \Doctrine\DBAL\Schema\Sequence) {
$sequence = $sequence->getName(); $sequence = $sequence->getQuotedName($this);
} }
return 'DROP SEQUENCE ' . $sequence; return 'DROP SEQUENCE ' . $sequence;
...@@ -469,11 +469,11 @@ LEFT JOIN all_cons_columns r_cols ...@@ -469,11 +469,11 @@ LEFT JOIN all_cons_columns r_cols
public function getDropForeignKeySQL($foreignKey, $table) public function getDropForeignKeySQL($foreignKey, $table)
{ {
if ($foreignKey instanceof \Doctrine\DBAL\Schema\ForeignKeyConstraint) { if ($foreignKey instanceof \Doctrine\DBAL\Schema\ForeignKeyConstraint) {
$foreignKey = $foreignKey->getName(); $foreignKey = $foreignKey->getQuotedName($this);
} }
if ($table instanceof \Doctrine\DBAL\Schema\Table) { if ($table instanceof \Doctrine\DBAL\Schema\Table) {
$table = $table->getName(); $table = $table->getQuotedName($this);
} }
return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey; return 'ALTER TABLE ' . $table . ' DROP CONSTRAINT ' . $foreignKey;
...@@ -502,7 +502,7 @@ LEFT JOIN all_cons_columns r_cols ...@@ -502,7 +502,7 @@ LEFT JOIN all_cons_columns r_cols
$fields = array(); $fields = array();
foreach ($diff->addedColumns AS $column) { foreach ($diff->addedColumns AS $column) {
$fields[] = $this->getColumnDeclarationSQL($column->getName(), $column->toArray()); $fields[] = $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
} }
if (count($fields)) { if (count($fields)) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' ADD (' . implode(', ', $fields) . ')'; $sql[] = 'ALTER TABLE ' . $diff->name . ' ADD (' . implode(', ', $fields) . ')';
...@@ -511,19 +511,19 @@ LEFT JOIN all_cons_columns r_cols ...@@ -511,19 +511,19 @@ LEFT JOIN all_cons_columns r_cols
$fields = array(); $fields = array();
foreach ($diff->changedColumns AS $columnDiff) { foreach ($diff->changedColumns AS $columnDiff) {
$column = $columnDiff->column; $column = $columnDiff->column;
$fields[] = $column->getName(). ' ' . $this->getColumnDeclarationSQL('', $column->toArray()); $fields[] = $column->getQuotedName($this). ' ' . $this->getColumnDeclarationSQL('', $column->toArray());
} }
if (count($fields)) { if (count($fields)) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' MODIFY (' . implode(', ', $fields) . ')'; $sql[] = 'ALTER TABLE ' . $diff->name . ' MODIFY (' . implode(', ', $fields) . ')';
} }
foreach ($diff->renamedColumns AS $oldColumnName => $column) { foreach ($diff->renamedColumns AS $oldColumnName => $column) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME COLUMN ' . $oldColumnName .' TO ' . $column->getName(); $sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME COLUMN ' . $oldColumnName .' TO ' . $column->getQuotedName($this);
} }
$fields = array(); $fields = array();
foreach ($diff->removedColumns AS $column) { foreach ($diff->removedColumns AS $column) {
$fields[] = $column->getName(); $fields[] = $column->getQuotedName($this);
} }
if (count($fields)) { if (count($fields)) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' DROP COLUMN ' . implode(', ', $fields); $sql[] = 'ALTER TABLE ' . $diff->name . ' DROP COLUMN ' . implode(', ', $fields);
......
...@@ -342,12 +342,12 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -342,12 +342,12 @@ class PostgreSqlPlatform extends AbstractPlatform
$sql = array(); $sql = array();
foreach ($diff->addedColumns as $column) { foreach ($diff->addedColumns as $column) {
$query = 'ADD ' . $this->getColumnDeclarationSQL($column->getName(), $column->toArray()); $query = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
$sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query; $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query;
} }
foreach ($diff->removedColumns as $column) { foreach ($diff->removedColumns as $column) {
$query = 'DROP ' . $column->getName(); $query = 'DROP ' . $column->getQuotedName($this);
$sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query; $sql[] = 'ALTER TABLE ' . $diff->name . ' ' . $query;
} }
...@@ -388,7 +388,7 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -388,7 +388,7 @@ class PostgreSqlPlatform extends AbstractPlatform
} }
foreach ($diff->renamedColumns as $oldColumnName => $column) { foreach ($diff->renamedColumns as $oldColumnName => $column) {
$sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME COLUMN ' . $oldColumnName . ' TO ' . $column->getName(); $sql[] = 'ALTER TABLE ' . $diff->name . ' RENAME COLUMN ' . $oldColumnName . ' TO ' . $column->getQuotedName($this);
} }
if ($diff->newName !== false) { if ($diff->newName !== false) {
...@@ -408,7 +408,7 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -408,7 +408,7 @@ class PostgreSqlPlatform extends AbstractPlatform
*/ */
public function getCreateSequenceSQL(\Doctrine\DBAL\Schema\Sequence $sequence) public function getCreateSequenceSQL(\Doctrine\DBAL\Schema\Sequence $sequence)
{ {
return 'CREATE SEQUENCE ' . $sequence->getName() . return 'CREATE SEQUENCE ' . $sequence->getQuotedName($this) .
' INCREMENT BY ' . $sequence->getAllocationSize() . ' INCREMENT BY ' . $sequence->getAllocationSize() .
' MINVALUE ' . $sequence->getInitialValue() . ' MINVALUE ' . $sequence->getInitialValue() .
' START ' . $sequence->getInitialValue(); ' START ' . $sequence->getInitialValue();
...@@ -422,7 +422,7 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -422,7 +422,7 @@ class PostgreSqlPlatform extends AbstractPlatform
public function getDropSequenceSQL($sequence) public function getDropSequenceSQL($sequence)
{ {
if ($sequence instanceof \Doctrine\DBAL\Schema\Sequence) { if ($sequence instanceof \Doctrine\DBAL\Schema\Sequence) {
$sequence = $sequence->getName(); $sequence = $sequence->getQuotedName($this);
} }
return 'DROP SEQUENCE ' . $sequence; return 'DROP SEQUENCE ' . $sequence;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment