Forum: Ruby on Rails Cmd line arg to specify DB for rake migrate?

Posted by jmcguckin (Guest)
on 2012-11-20 21:34
(Received via mailing list)
I want to say

   bundle exec rake db:migrate

but, I don't want to use the default database. Is there a command line
argument I can use?

Thanks,

Joe
Posted by Walter Davis (walterdavis)
on 2012-11-20 21:48
(Received via mailing list)
On Nov 20, 2012, at 3:33 PM, jmcguckin wrote:

> I want to say
>
>    bundle exec rake db:migrate
>
> but, I don't want to use the default database. Is there a command line argument 
I can use?

If you define an environment for it in database.yml, then you can just 
do this:

rake db:migrate RAILS_ENV=my_production

Walter
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.