Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[DBAL-42] MySQLPlatform::getAlterTableSQL() with regard with Doctrine…

… Type Detection.
  • Loading branch information...
commit 18bed8f2e1d6cccb534dd0150f3d06d1bd781f55 1 parent 30458e8
@beberlei beberlei authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
View
12 lib/Doctrine/DBAL/Platforms/MySqlPlatform.php
@@ -422,7 +422,9 @@ public function getAlterTableSQL(TableDiff $diff)
}
foreach ($diff->addedColumns AS $fieldName => $column) {
- $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
+ $columnArray = $column->toArray();
+ $columnArray['comment'] = $this->getColumnComment($column);
+ $queryParts[] = 'ADD ' . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray);
}
foreach ($diff->removedColumns AS $column) {
@@ -432,13 +434,17 @@ public function getAlterTableSQL(TableDiff $diff)
foreach ($diff->changedColumns AS $columnDiff) {
/* @var $columnDiff Doctrine\DBAL\Schema\ColumnDiff */
$column = $columnDiff->column;
+ $columnArray = $column->toArray();
+ $columnArray['comment'] = $this->getColumnComment($column);
$queryParts[] = 'CHANGE ' . ($columnDiff->oldColumnName) . ' '
- . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
+ . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray);
}
foreach ($diff->renamedColumns AS $oldColumnName => $column) {
+ $columnArray = $column->toArray();
+ $columnArray['comment'] = $this->getColumnComment($column);
$queryParts[] = 'CHANGE ' . $oldColumnName . ' '
- . $this->getColumnDeclarationSQL($column->getQuotedName($this), $column->toArray());
+ . $this->getColumnDeclarationSQL($column->getQuotedName($this), $columnArray);
}
$sql = array();
Please sign in to comment.
Something went wrong with that request. Please try again.