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

后端 未结 9 1890
日久生厌
日久生厌 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:41

    I had the same issue, because instead "$rails generate migration add_reset_to_users reset_digest:string \

    reset_sent_at:datetime" I miss typed "$rails generate migration add_reset_to_users reset_digest:string\ reset_sent_at:datetime". I first removed the "reset" migration using DB browser for SQLite, then I checked schema.rb file, in that instead of " t.string "reset_digest" " it was " t. "reset_digest" ". I edited it to "t.string" then rails db:migrate VERSION="previous one" and it worked. Now my latest migration is down. I deleted my previous migration file and then executed "$rails generate migration add_reset_to_users reset_digest:string reset_sent_at:datetime", I got the migration file as I wanted now.

提交回复
热议问题