This project is archived and is in readonly mode.

#2997 ✓resolved
anthony_caliendo

[PATCH] db:drop:all throws error when database does not exist

Reported by anthony_caliendo | August 5th, 2009 @ 09:14 PM | in 2.3.6

I searched and could not find this issue reported before...

If you invoke "db:drop RAILS_ENV=x" but the database does not exist for "x", then you get a friendly message saying that the database does not exist. However, if you do "db:drop:all" and the database for one of the environments does not exist, you will get an error thrown which will stop the rake command chain.

This prevents you from doing something like "rake db:drop:all db:create:all db:migrate" (or creating a rake task which depends on those) since the db:drop:all will fail if the database does not yet exist. Also, this is inconsistent with the behavior of db:drop.

Attached is a patch which fixes the issue by making db:drop:all behave more like db:drop.

Comments and changes to this ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

Referenced by

Pages