[DMIG-31] $table->renameColumn() actually drops the column Created: 23/Dec/11  Updated: 19/Jun/12  Resolved: 04/Jun/12

Status: Resolved
Project: Doctrine Migrations
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Nikola Petkanski Assignee: Benjamin Eberlei
Resolution: Duplicate Votes: 0
Labels: None

symfony 2.0.7


Tried to use renameColumn() into one of my migration scripts and it dropped the table.

The code does not seem okay as well:

namespace Doctrine\DBAL\Schema;
class Table extends AbstractAsset
    * Rename Column
    * @param string $oldColumnName
    * @param string $newColumnName
    * @return Table
public function renameColumn($oldColumnName, $newColumnName)
    $column = $this->getColumn($oldColumnName);

    return $this;

Comment by Tyler Sommer [ 06/Feb/12 ]

Doctrine\DBAL\Schema\Table is actually not a part of Doctrine Migrations, rather just the Database Abstraction Layer project. Recommend this gets sorted as such.

Comment by David Buchmann [ 04/Jun/12 ]

this is a duplicate of DMIG-22

any chances of getting the issue fixed?

Comment by Benjamin Eberlei [ 04/Jun/12 ]

From the internals this is really complicated. I will delete the method instead.

Comment by Gonzalo Sainz-Trapaga [ 19/Jun/12 ]

Does this mean Doctrine Migrations won't support renaming columns? I'm sorry but the alternative of not supporting it at all doesn't really work. It's a basic operation for DB schema changes, which are the whole point of migrations. What exactly is the proble? I have seen the algorithms for inferring that a column or table should be renamed and they are pretty simplistic. Maybe the solution is adding some sort of hinting to the renameX operations so that there is metadata inside the Table Schemas saying what the original columns or tables were. Thoughts?

Generated at Fri Oct 09 20:06:17 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.