xta
xta

Reputation: 809

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?

Upvotes: 1

Views: 847

Answers (1)

sorens
sorens

Reputation: 5060

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?

Upvotes: 3

Related Questions