I'm running Rails 3.0.3 and I accidentally made a typo in my migration: I created a migration that creates a new column with a type of boolen
(it should have been boolean
). I ran the migration and Rails didn't warn me that this was an invalid type of column, which I could have sworn it did in previous versions?
Now whenever I try to add, remove, or modify anything in a migration I get the following error:
undefined method `to_sym' for nil:NilClass
I can't even rollback or drop. I have an earlier version of the database and file tree saved, but this problem is driving me crazy because it isn't the first time I've seen this happen.
How can I effectively remove the column without having Rails complain (and preferably without digging into the database by hand)?
If you are using the SQLite database, you probably getting this error because SQLLite doesn't provide the drop column feature. http://www.sqlite.org/faq.html#q11
SQLLite suggests that you create a temporary table with only the columns that you need from your original table, transfer data, and then swap the tables.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With