Doctrine Migrations
  1. Doctrine Migrations
  2. DMIG-31

$table->renameColumn() actually drops the column

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Duplicate
    • Labels:
      None
    • Environment:
      symfony 2.0.7

      Description

      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);
          $this->dropColumn($oldColumnName);
      
          $column->_setName($newColumnName);
          return $this;
      }
      ..
      

        Activity

        Nikola Petkanski created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Duplicate [ 3 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            Nikola Petkanski
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: