
ALTER TABLE ... RENAME COLUMN syntax incorrect for dm-migrations
Reported by Phil | December 1st, 2008 @ 12:38 AM
The default syntax used to rename a column is not compatible with MySQL. From the docs it should instead be
ALTER TABLE tbl_name CHANGE [COLUMN] old_col_name new_col_name column_definition
Comments and changes to this ticket
-
Dan Kubb (dkubb) December 4th, 2008 @ 03:56 AM
- Assigned user cleared.
- State changed from new to unconfirmed
-
Dan Kubb (dkubb) December 12th, 2008 @ 12:42 AM
- Assigned user set to Paul Sadauskas (Rando)
Paul, would you mind looking into this? If it is an issue, please mark it as confirmed. Also, if you do decide to take it on, please mark it as accepted so we know you're working on it.
-
Paul Sadauskas (Rando) December 12th, 2008 @ 04:07 PM
- Tag set to migrations
Yup, confirmed.
To fix this, all that needs done is adding a TableModifier class to http://github.com/sam/dm-more/tr... and overriding the 'rename_column' method, as found here: http://github.com/sam/dm-more/tr...
-
Paul Sadauskas (Rando) December 12th, 2008 @ 04:07 PM
- State changed from unconfirmed to confirmed
-
Emma Persky December 30th, 2008 @ 11:53 AM
- Tag changed from migrations to alter table, migrations, mysql, specs
I have written what I think is a patch for this problem.
There were no specs for the MySQL adapter in dm-migrations so I created the spec file. I also mimicked those from sqlite3 for the core functionality.
I then added the class TableModifier with the method rename_column. The method extracts the existing column from the table columns, updates it's name, and then generates the correct ALTER TABLE statement.
I hope it is ok that both of these are in one patch, but the later relies on the former!
This is my first patch, so sorry if it's all wrong, but let me know what any problems are and I'll try to fix them.
Emma
-
-
Dan Kubb (dkubb) February 16th, 2010 @ 12:35 AM
- State changed from confirmed to hold
- Assigned user cleared.
When I attempted to fix this bug I found numerous problems with dm-migrations. I think dm-migrations should be queued up for a rewrite before DM 1.0 is released, since it's one of the weakest official DM libs.
Going to put this on hold while we plan out how to approach this.
-
Dan Kubb (dkubb) June 1st, 2010 @ 02:01 PM
I should add that we ran out of time to rewrite dm-migrations before the 1.0 launch. I am going to see what I can do about getting this in before the 1.1 release.
-
Piotr Solnica (solnic) May 17th, 2011 @ 02:29 AM
- Tag changed from alter table, migrations, mysql, specs to alter table, dm-migrations, migrations, mysql, specs
- Milestone order changed from 0 to 0
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
Attachments
Referenced by
-
1299 "change_column" doesn't work on MySQL I found a duplicated ticket #680 now. please change statu...