ruby on rails - rake db:migrate is not creating user table -
i have following migrations
problem rake db:migrate
not executing first migration , no users
table created.
what reason this?
what reason this?
main reason you've ran migration - or perhaps later migrations - , rails therefore not think needs run it.
a way see if case open db/schema.rb
file:
you'll see latest migration schema running. if supersedes 1 you're trying invoke, not run.
--
fixes
you could generate new migration, , copy code over:
$ rails g migration addusers2
you'd add following:
#db/migrate/_____.rb class addusers2 < activerecord::migration def change create_table :users |t| t.string :name t.timestamps end end end
alternatively, wipe db , start again. can achieved using rake schema:load
. this wipe data , start again
Comments
Post a Comment