Creating model in rails does not create a corresponding table in mysql -
havent come across before, generating model in rails
rails g model rating ratings:integer
at point no migration file beingness generated
i run
rake db:migrate
nothing happens @ point , model doesn’t written table though myapp_development , myapp_test exists
so checked mysql, logged in
mysql
and logged straight in, neither database existed in there, logged in 1 time again time command
mysql -u root
and in here databases exist. know going on here , how models create corresponding table?
database.yml
development: adapter: mysql2 encoding: utf8 reconnect: false database: recipes_development pool: 5 username: root password:
thanks
check timestamps on migration file , db/schema.rb
file. if you've been working on different branches of git recently, have problems timestamps.
if case, seek deleting schema.rb
file, re-running rake db:migrate
mysql ruby-on-rails ruby-on-rails-3 model
No comments:
Post a Comment