[PATCH] Add ability to update column attributes
Reported by Nate Wiger | March 23rd, 2008 @ 08:22 PM
Auto migrations rocks - but it doesn't properly detect changes in column attributes. That is, if you had:
t.decimal :cost, :precision => 0
And changed it to:
t.decimal :cost, :precision => 4
This would not be reflected correctly. The attached patch provides this functionality.
Also, I fixed the hardcoded index names, replacing them with AR::B.index_name (needed for Oracle compatibility). I also replaced the hardcoded "id" with get_primary_key(table_name)
Thanks for an awesome plugin!
Comments and changes to this ticket
-
Nate Wiger March 24th, 2008 @ 01:21 PM
Here's a much better patch that uses Struct.each_pair to dynamically get a list of all attributes.
-
defunkt March 24th, 2008 @ 02:20 PM
- → Assigned user changed from Chris Wanstrath to PJ Hyett
-
Nate Wiger June 30th, 2008 @ 10:13 PM
- → Tag changed from to auto_migrations enhancement patch
Hey guys, anything going on with this? Is the auto_migrations plugin still being actively maintained??
-
PJ Hyett July 2nd, 2008 @ 04:06 PM
please fork and send a pull request via:
Please Login or create a free account to add a new comment.
You can update this ticket by sending an email to from your email client. (help)
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
