Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

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

#2997

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.

Reported by anthony_caliendo · August 5th, 2009 @ 09:14 PM

State: resolved
Milestone: 2.3.6
Assigned to: Jeremy Kemper Jeremy Kemper
Importance: Medium

Activity

  1. Sharad Jain
  2. jason sendelbach
    jason sendelbach
    • Assigned user set to josh

    +1

    August 5th, 2009 @ 09:52 PM

  3. jason sendelbach
  4. John McCaffrey
    John McCaffrey
    • 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

    August 6th, 2009 @ 06:15 PM

  5. José Valim
    José Valim
    • Tag changed from 2.3.2, database, databases.rake, drop to 2.3.2, bugmash, database, databases.rake, drop

    August 8th, 2009 @ 01:52 PM

  6. Elad Meidar
    Elad Meidar

    +1 except patch is not applying. "Patch does not have a valid e-mail address."

    August 8th, 2009 @ 04:28 PM

  7. Nikolay Petrachkov
    Nikolay Petrachkov
    • Assigned user set to José Valim

    +1 Patch works.

    August 8th, 2009 @ 05:22 PM

  8. Repository
  9. Rizwan Reza
    Rizwan Reza

    verified

    -1 This has already been applied to master. It's resolved.

    August 8th, 2009 @ 05:55 PM

  10. Pratik
    Pratik
    • Tag changed from 2.3.2, bugmash, database, databases.rake, drop to 2.3.2, database, databases.rake, drop

    August 8th, 2009 @ 07:46 PM

  11. Joe Moore
  12. Joe Moore
    Joe Moore
    • Tag changed from 2.3.2, database, databases.rake, drop to 2.3.2, database, databases.rake, drop, patch

    August 25th, 2009 @ 01:27 AM

  13. José Valim
    José Valim
    • State changed from resolved to open
    • Assigned user changed from José Valim to Jeremy Kemper

    August 25th, 2009 @ 08:25 AM

  14. Neeraj Singh
    Neeraj Singh

    I could not apply the patch which is added. Created a new patch.

    April 20th, 2010 @ 06:52 PM

  15. Neeraj Singh
    Neeraj Singh

    forgot to attach the patch. Here is the patch.

    April 20th, 2010 @ 06:53 PM

  16. Rizwan Reza
    Rizwan Reza
    • 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

    May 15th, 2010 @ 03:17 PM

  17. Repository
  18. Rizwan Reza
    Rizwan Reza
    • Tag changed from 2.3.2, bugmash-review, database, databases.rake, drop, patch to 2.3.2, database, databases.rake, drop, patch

    May 15th, 2010 @ 06:35 PM

  19. Rizwan Reza
    Rizwan Reza
    • State changed from resolved to open

    May 15th, 2010 @ 06:38 PM

  20. Rizwan Reza
    Rizwan Reza
    • State changed from open to resolved

    May 15th, 2010 @ 06:39 PM