新たにカラムを追加する際、

StandardError: An error has occurred, this and all later migrations canceled:

undefined method `shop_id' for ....

というエラーが出てきました

migration ファイルの中で以下のようにインスタンスを作っていたことが原因でした

Something.create()

参考にした記事
[db:migrate] error on migration – undefined method `file_changed?’ #195
Rake aborted. Migrate aborted. Standard Error. Undefined Method. So what exactly causes this?
rake db:migrate fails when using this gem with mysql #31
Problems with migration, “undefined method `ext’” in Active Record?

コメントをどうぞ

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

CAPTCHA