diff options
author | eileencodes <eileencodes@gmail.com> | 2018-03-16 14:04:09 -0400 |
---|---|---|
committer | eileencodes <eileencodes@gmail.com> | 2018-03-21 14:00:58 -0400 |
commit | 5eb4488d02fd975ff5c387a8697fc58cca28b9b4 (patch) | |
tree | 9861f50547a0e08cb2347abea43b28c133c292af /activesupport/lib/active_support/notifications/fanout.rb | |
parent | d79d6867a23b90e0f9e2670a3300c9a044c84dca (diff) | |
download | rails-5eb4488d02fd975ff5c387a8697fc58cca28b9b4.tar.gz rails-5eb4488d02fd975ff5c387a8697fc58cca28b9b4.tar.bz2 rails-5eb4488d02fd975ff5c387a8697fc58cca28b9b4.zip |
Add ability to create/drop/migrate all dbs for a given env
`each_current_configuration` is used by create, drop, and other methods
to find the configs for a given environment and returning those to the
method calling them.
The change here allows for the database commands to operate on all the
configs in the environment. Previously we couldn't slice the hashes and
iterate over them becasue they could be two tier or could be three
tier. By using the database config structs we don't need to care whether
we're dealing with a three tier or two tier, we can just parse all the
configs based on the environment.
This makes it possible for us to run `bin/rails db:create` and it will
create all the configs for the dev and test environment ust like it does
for a two tier - it creates the db for dev and test. Now `db:create`
will create `primary` for dev and test, and `animals` for dev and test
if our database.yml looks like:
```
development:
primary:
etc
animals:
etc
test:
primary:
etc
animals:
etc
```
This means that `bin/rails db:create`, `bin/rails db:drop`, and
`bin/rails db:migrate` will operate on the dev and test env for both
primary and animals ds.
Diffstat (limited to 'activesupport/lib/active_support/notifications/fanout.rb')
0 files changed, 0 insertions, 0 deletions