1
0
mirror of synced 2025-01-18 06:21:40 +03:00

fixed processRenamedColumns() to work with mysql migrations

This commit is contained in:
samw3 2007-11-08 17:10:08 +00:00
parent d0d026af05
commit 87d58d9964

View File

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