1

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?

1
  • 2
    I'm with sorens, although the answer seems more of a question--what makes you think it's not using the dev DB if you don't provide an environment-specific option? Commented Nov 16, 2011 at 2:46

1 Answer 1

3

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?

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, you were right. Not sure how I was getting data in my test db the other day

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.