Commit 87d58d99 authored by samw3's avatar samw3

fixed processRenamedColumns() to work with mysql migrations

parent d0d026af
...@@ -116,9 +116,14 @@ class Doctrine_Migration_Process ...@@ -116,9 +116,14 @@ class Doctrine_Migration_Process
public function processRenamedColumns($columns) public function processRenamedColumns($columns)
{ {
foreach ($columns as $column) { foreach ($columns as $column) {
$conn = $this->getConnection($column['tableName']); $conn = $this->getConnection($column['tableName']);
$conn->export->alterTable($column['tableName'], array('rename' => array($column['oldColumnName'] => array('name' => $column['newColumnName'])))); $columnList = $conn->import->listTableColumns($column['tableName']);
if (isset($columnList[$column['oldColumnName']])) {
$conn->export->alterTable($column['tableName'],
array('rename' => array($column['oldColumnName'] => array('name' => $column['newColumnName'],
'definition'=>$columnList[$column['oldColumnName']]))));
}
} }
} }
......
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