On Migration: undefined method `to_sym' for nil:NilClass

后端 未结 9 1889
日久生厌
日久生厌 2020-12-10 12:27

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 b

9条回答
  •  南方客
    南方客 (楼主)
    2020-12-10 12:35

    I had almost exactly the same issue (had misspelled bolean) and couldn't get rake db:rollbackto work, nor dropping the column name (because of SQLite3), using Rails 4.0.2.

    As I didn't care if the DB data was deleted, this is how I fixed it:

    1. Drop the entire database rake db:drop
    2. Edit the [timestamp]_migration_name.rb file to correctly say boolean
    3. Create the database again rake db:create
    4. Migrate the data rake db:migrate
    5. (Restart the web server, et voila!)

提交回复
热议问题