Is it possible to create tables in two databases using db:create ? For example, can I have entries in database.yml for one_development and two_development , and both of them are created using rake db:create ? I know rake db: create: everything works - I'm just wondering if there is a way to segment what is created depending on RAILS_ENV?
db:create
database.yml
one_development
two_development
rake db:create
For one_development, you can run the following command:
RAILS_ENV=one_development rake db:create
For two_development, you can run the following command:
RAILS_ENV=two_development rake db:create
Override the rake task or create a new one that runs rake db:create for the two required environments.
It seems that all data sets are automatic. See Source:
http://dev.rubyonrails.org/changeset/6849
It doesn't seem to use RAILS_ENV as drop, etc.