This project is archived and is in readonly mode.
[PATCH] rake db:create creates development db only
-
Mikel Lindsaar
What problem are you trying to solve here?
Ie, how does the current system cause you problems?
This is the usual flow for most people who are testing:
$ rails g migration ... $ rake db:migrate $ rake testWhich promptly blows up -> no test database.
Mikel
-
Santiago Pastorino
I'm trying to have rake db:create to not create test database.
I think that should be the right way and the least surprise for users. -
Santiago Pastorino
santiago@debian:/tmp/test_app$ ls db/
seeds.rb
santiago@debian:/tmp/test_app$ rake db:create
(in /tmp/test_app) santiago@debian:/tmp/test_app$ ls db/
development.sqlite3 seeds.rb test.sqlite3
santiago@debian:/tmp/test_app$ rake db:drop
(in /tmp/test_app) santiago@debian:/tmp/test_app$ ls db/
seeds.rb test.sqlite3
santiago@debian:/tmp/test_app$ rake db:drop RAILS_ENV=test
(in /tmp/test_app) santiago@debian:/tmp/test_app$ ls db/
seeds.rb -
Jeremy Kemper
This is because db:reset and db:setup tasks depend on it, and it's convenient to have test db created along with dev.
-
viktor tron (strawberry)
this issue
https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets...
points out this inconsistency between create and drop behaviour and
to my satisfaction a non-sneaky solution seems agreed upon:to have
RAILS_ENV=development rake db:createdo what is says (create ONLY dev and not test) in the doc
$ rake -D db:create (in /home/tron/Work/Repowt) rake db:create Create the database from config/database.yml for the current Rails.env (use db:create:all to create all dbs in the config)
