rails/rails — pull request #12956 by iamvery (2013-11-19 21:28:25+00:00)
Title: Explicitly exit with status "1" for create and drop failures

Second attempt at this PR. This feature was merged previously and subsequently [reverted](https://github.com/rails/rails/commit/728096542aef4820440b2d758cfdc579b399f1e6) due to a [change in functionality for `db:setup`](https://github.com/rails/rails/commit/22f80ae57b26907f662b7fd50a7270a6381e527e#commitcomment-4640676).

---

The regression was due to rake failing out early for required tasks in the pipeline of `db:setup`. My fix was to create a "soft fail" version of `db:create` (`db:try_create`) that is used in that pipeline to prevent early failure. For the sake of DRY, I also created an undocumented `db:create!` which does not suppress the stacktrace. Is that sane?

Also I noticed a curious thing in the dependencies of some of the nested tasks. I'll leave a comment in the code for input. I didn't want another change to affect this PR.

cc @rafaelfranca, @rubys