This project is archived and is in readonly mode.
[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
-
jason sendelbach August 5th, 2009 @ 09:53 PM
- Assigned user cleared.
-
John McCaffrey August 6th, 2009 @ 06:15 PM
- Tag changed from 2.3.2, database, databases.rake to 2.3.2, database, databases.rake, drop
+1 Would be nice to chain my rake tasks cleanly
-
José Valim August 8th, 2009 @ 01:52 PM
- Tag changed from 2.3.2, database, databases.rake, drop to 2.3.2, bugmash, database, databases.rake, drop
-
Elad Meidar August 8th, 2009 @ 04:28 PM
+1 except patch is not applying. "Patch does not have a valid e-mail address."
-
Repository August 8th, 2009 @ 05:54 PM
- State changed from new to resolved
(from [ed8a0a1c2370ab8715434ba824b2826d807401d5]) Ensure db:drop:all doesn't error out on exception [#2997 state:resolved] [Anthony Caliendo] http://github.com/rails/rails/commit/ed8a0a1c2370ab8715434ba824b282...
-
Rizwan Reza August 8th, 2009 @ 05:55 PM
verified
-1 This has already been applied to master. It's resolved.
-
Pratik August 8th, 2009 @ 07:46 PM
- Tag changed from 2.3.2, bugmash, database, databases.rake, drop to 2.3.2, database, databases.rake, drop
-
Joe Moore August 25th, 2009 @ 01:27 AM
- Tag changed from 2.3.2, database, databases.rake, drop to 2.3.2, database, databases.rake, drop, patch
-
José Valim August 25th, 2009 @ 08:25 AM
- State changed from resolved to open
- Assigned user changed from José Valim to Jeremy Kemper
-
Neeraj Singh April 20th, 2010 @ 06:52 PM
I could not apply the patch which is added. Created a new patch.
-
Rizwan Reza May 15th, 2010 @ 03:17 PM
- Milestone set to 2.3.6
- Tag changed from 2.3.2, database, databases.rake, drop, patch to 2.3.2, bugmash-review, database, databases.rake, drop, patch
-
Repository May 15th, 2010 @ 06:34 PM
- State changed from open to resolved
(from [22b020db3ed3992b510b91d3fd423e510b9369e4]) db:drop:all throws error when database does not exist [#2997 state:resolved]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/22b020db3ed3992b510b91d3fd423e... -
Rizwan Reza May 15th, 2010 @ 06:35 PM
- Tag changed from 2.3.2, bugmash-review, database, databases.rake, drop, patch to 2.3.2, database, databases.rake, drop, patch
-
Rizwan Reza May 15th, 2010 @ 06:38 PM
- State changed from resolved to open
-
Rizwan Reza May 15th, 2010 @ 06:39 PM
- State changed from open to resolved
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>
People watching this ticket
Attachments
Tags
Referenced by
- 2997 [PATCH] db:drop:all throws error when database does not exist (from [ed8a0a1c2370ab8715434ba824b2826d807401d5]) Ensure ...
- 2997 [PATCH] db:drop:all throws error when database does not exist (from [22b020db3ed3992b510b91d3fd423e510b9369e4]) db:drop...