Rails: I update migration file then run db:migrate, but my schema isn't updating

前端 未结 7 1275
生来不讨喜
生来不讨喜 2020-12-24 13:27

I\'m trying to add an extra field to one of my tables.

I\'ve added the field in the migration file (under db\\migrate), then ran \'rake db:migrate\' which ran withou

7条回答
  •  春和景丽
    2020-12-24 14:00

    Once u do rake db:migrate then again u cannot add column to that file.You have to generate a new migration file by using rails g migration add_columnname_to_tablename for adding that particular column and do rake db:migrate.That's it !!!

提交回复
热议问题