1

Sorry if the question seems too simple, but I am quite new to rails. I generated scaffold in development mode. Then I migrated the database and it edited the mysql app_development table but not the mysql app_production table . Is there a specific command to migrate it also to the production table ?

4

2 回答 2

1

If what you're saying is that you didn't use migrations to perform some changes and now rake db:migrate doesn't produce the database structure that you want (obviously, because it has no idea that you made those changes), you still can use the schema.rb.

rake db:schema:dump

Will read the db and generate a schema.rb for it. Then you can load this schema.rb on production with

rake db:schema:load RAILS_ENV=production

Also, you can delete everything and create the database from scratch using the schema.rb file with

rake db:reset RAILS_ENV=production
于 2013-06-25T19:34:38.813 回答
0

For window just write db:migrate and for Linux sudo rake db:migrate

于 2013-07-01T08:32:24.267 回答