[DC-768] Renaming a NOT NULL column without a default value fails in MySQL migrations Created: 25/Jun/10  Updated: 28/Jan/11

Status: Open
Project: Doctrine 1
Component/s: Migrations
Affects Version/s: 1.2.2
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Jack Sleight Assignee: Jonathan H. Wage
Resolution: Unresolved Votes: 2
Labels: None

Attachments: Text File DC-768.patch    

 Description   

When trying to rename a column that is NOT NULL and has no default value, Doctrine generates this SQL:

ALTER TABLE `article` CHANGE `typeid` `listid` INT DEFAULT NULL NOT NULL

Which fails. It should be:

ALTER TABLE `article` CHANGE `typeid` `listid` INT NOT NULL


 Comments   
Comment by Matthew Hughes [ 11/Jan/11 ]

can confirm this behaviour on mysql w/ 1.2.4

Comment by Matthew Hughes [ 28/Jan/11 ]

Attached is a patch that solves the issue.
It's not the most elegan solution.
But works and all tests pass.

Generated at Tue Sep 30 18:15:09 UTC 2014 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.