Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Remove Doctrine\DBAL\Table\Schema#renameColumn()

commit 9b0bd8817cb74c4aefba043c7e59f94641cc5b15 1 parent 4eaa44c
Benjamin Eberlei authored June 30, 2012
9  UPGRADE
... ...
@@ -1,8 +1,15 @@
1 1
 # Upgrade to 2.3
2 2
 
  3
+## Doctrine\DBAL\Schema\Table#renameColumn() removed
  4
+
  5
+Doctrine\DBAL\Schema\Table#renameColumn() was removed, because it drops and recreates
  6
+the column instead. There is no fix available, because a schema diff
  7
+cannot reliably detect if a column was renamed or one column was created
  8
+and another one dropped.
  9
+
3 10
 ## Schema Filter paths
4 11
 
5  
-The Filter Schema assets expression is not wrapped in () anymore for the regexp.
  12
+The Filter Schema assets expression is not wrapped in () anymore for the regexp automatically.
6 13
 
7 14
 Before:
8 15
 
8  lib/Doctrine/DBAL/Schema/Table.php
@@ -270,11 +270,9 @@ public function addColumn($columnName, $typeName, array $options=array())
270 270
      */
271 271
     public function renameColumn($oldColumnName, $newColumnName)
272 272
     {
273  
-        $column = $this->getColumn($oldColumnName);
274  
-        $this->dropColumn($oldColumnName);
275  
-
276  
-        $column->_setName($newColumnName);
277  
-        return $this;
  273
+        throw new DBALException("Table#renameColumn() was removed, because it drops and recreates " .
  274
+            "the column instead. There is no fix available, because a schema diff cannot reliably detect if a " .
  275
+            "column was renamed or one column was created and another one dropped.");
278 276
     }
279 277
 
280 278
     /**

0 notes on commit 9b0bd88

Johannes

Maybe add that users can use explicit SQL in their migration file to migrate the data?

Benjamin Eberlei

done

Please sign in to comment.
Something went wrong with that request. Please try again.