Skip to content

Commit

Permalink
Fix escaping of column name for specific alter table case
Browse files Browse the repository at this point in the history
When changing the length of a field, the column name needs to be escaped
properly.
  • Loading branch information
PVince81 committed Jul 1, 2014
1 parent 5eb36c7 commit f8c1d77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Doctrine/DBAL/Platforms/PostgreSqlPlatform.php
Expand Up @@ -510,7 +510,7 @@ public function getAlterTableSQL(TableDiff $diff)
}

if ($columnDiff->hasChanged('length')) {
$query = 'ALTER ' . $column->getName() . ' TYPE ' . $column->getType()->getSqlDeclaration($column->toArray(), $this);
$query = 'ALTER ' . $oldColumnName . ' TYPE ' . $column->getType()->getSqlDeclaration($column->toArray(), $this);
$sql[] = 'ALTER TABLE ' . $diff->getName()->getQuotedName($this) . ' ' . $query;
}
}
Expand Down

0 comments on commit f8c1d77

Please sign in to comment.