I'have created model using rails generate model users.i have created new data base readit_development and granted all privileges on this database to user readitadmin. In my database.yml file i have given user name as readitadmin and password as "password" and adapter mysql2. after rake db:schema:dump command file db/migrate/20160914144019_create_users.rb was created. after db:migrate command i can not find table users in the database. i didn't get any error after db:migrate command. what could be the problem? i am naive to ruby on rails.
Asked
Active
Viewed 635 times
-1
-
Did you added any fields inside your user model? – Ravi Mariya Sep 14 '16 at 16:23
-
could it be possible that this is not the first time you run that migration ?, look in your `schema_migrations` table, and look for `20160914144019`, delete it if it's there. – fanta Sep 14 '16 at 16:33
-
@fantaI have deleted migration and drop table from database and destroyed model. Again created all those. Problem remain. Yes i have added t.String "email", :limit=> 50 AND t.colum,:string, :limit=» 50,:null=» false Field – Manish Sakariya Sep 14 '16 at 18:18
-
I have UP method with create_table specified and DOWN method with drop_table spefied in same migration. Is it possible that while i rake db:migrate both cancle each other and i am left with no table in database?? – Manish Sakariya Sep 14 '16 at 18:30
1 Answers
0
My model name was "users". Which is plural. But when i destroyed my model and created new model "user" then added some fields, db:migrate worked and created table for me in database. i don't what is wrong with plural model name.

Manish Sakariya
- 482
- 3
- 10