• E
    Add ability to create/drop/migrate all dbs for a given env · 5eb4488d
    eileencodes 提交于
    `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.
    5eb4488d
database_tasks.rb 11.9 KB