ruby on rails - rake db:migrate is not creating user table -


i have following migrations

enter image description here

problem rake db:migrate not executing first migration , no users table created.

what reason this?

enter image description here

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:

enter image description here

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

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -