Commit 18bed8f2 authored by Benjamin Eberlei's avatar Benjamin Eberlei

[DBAL-42] MySQLPlatform::getAlterTableSQL() with regard with Doctrine Type Detection.

parent 30458e8a
......@@ -422,7 +422,9 @@ class MySqlPlatform extends AbstractPlatform
}
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 @@ class MySqlPlatform extends AbstractPlatform
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();
......
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