简体   繁体   中英

only using development mysql db, not test or production in rails

I've created a new rails app (3.1.1) using MySQL. In database.yml, I've put in the login credentials for a remote MySQL server in development, while the test & production databases are set up with localhost. It appears that creating a scaffold and rake db:migrate goes into the test db?

How do I do force rails to only use development mysql db? I'd like db:create, db:migrate, etc. only create tables in the development (remote MySQL) server and NOT in test or production?

rake db:migrate and similar calls use your development environment, not your test one. If you want to migrate your test database, you would do

rake RAILS_ENV=test db:migrate

How are you determining that when you use rake db:migrate that this is going into your test DB?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM