views:

245

answers:

3

Can I create tables in two databases using db:create? For example, can I have entries in database.yml for one_development and two_development and have both get created by rake db:create? I know rake db:create:all works -- I am just wondering if there is a way to segment what is created depending on the RAILS_ENV?

A: 

It appears to do all the datasets automatically. See the source:

http://dev.rubyonrails.org/changeset/6849

It does not appear to uses RAILS_ENV like drop, etc.

MarkusQ
+1  A: 

Redefine the rake task or create a new one, which runs rake db:create for two environments that you need.

snitko
A: 

For one_development you can execute this command:

RAILS_ENV=one_development rake db:create

For two_development you can execute this command:

RAILS_ENV=two_development rake db:create
oskarae