rails/rails — pull request #14989 by popox (2014-05-06 09:47:14+00:00)
Title: Db migration status

## Context

With the following setup:
* An app database created but never setup from rails rake task
* Running the `db:migrate:status` rake task will return `Schema migrations table does not exist yet.` in the `STDOUT`.

__Rails has no method to detect programmatically if a database exists and if it has already been setup by the `db:setup` rake task__

## To discuss

I propose then to abort the `db:migrate:status` task with a non zero error code so that the message is sent to `STDERR`.
This will give an easy way to detect wether __the database has been setup or not__.

_E.g. in a cookbook:_
```ruby
execute 'bundle exec rake db:setup' do
not_if 'bundle exec rake db:migrate:status'
end
```