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?
views:
245answers:
3
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
2009-03-04 20:23:54
+1
A:
Redefine the rake task or create a new one, which runs rake db:create
for two environments that you need.
snitko
2009-03-04 20:59:32
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
2009-03-24 07:34:42