1. 30 6月, 2015 2 次提交
  2. 17 6月, 2015 1 次提交
  3. 16 6月, 2015 1 次提交
    • A
      Small refactor on db:reset · 68f6d534
      Arthur Neves 提交于
      db:reset should not prematurely load the environment, so, for instance,
      if there is any initializer that touches th DB, it will not touch that
      before droping it.
      
      Also this makes the code simpler.
      
      This changed was made back in 15fb4302
      , not sure why. But I am pretty much sure we should do it like this, as
      drop and setup should load its dependencies tasks if necessary.
      68f6d534
  4. 05 5月, 2015 1 次提交
  5. 27 4月, 2015 1 次提交
  6. 12 2月, 2015 1 次提交
  7. 08 1月, 2015 1 次提交
  8. 23 12月, 2014 1 次提交
  9. 05 12月, 2014 1 次提交
    • C
      Remove environment dependency for db:schema:load · 382a70c8
      Caleb Thompson 提交于
      All of the behavior :environment was giving (that db:schema:load needed)
      was provided as well with :load_config.
      
      This will address an issue introduced in
      https://github.com/rails/rails/pull/15394. The fact that db:schema:load
      now drops and creates the database causes the Octopus gem to have [an
      issue](https://github.com/tchandy/octopus/issues/273) during the drop
      step for the test database (which wasn't happening in db:schema:load
      before). The error looks like:
      
          ActiveRecord::StatementInvalid: PG::ObjectInUse: ERROR:  cannot drop the currently open database
          : DROP DATABASE IF EXISTS "app_test"
      
      Because of the timing, this issue is present in master, 4-2-*, and
      4.1.8.
      
      A note to forlorn developers who might see this: "Additionally" in a
      commit message means you should have a separate commit, with a separate
      justification for changes. Small commits with big messages are your
      friends.
      382a70c8
  10. 29 11月, 2014 1 次提交
  11. 26 11月, 2014 1 次提交
    • Y
      bring back `db:test:prepare`. · 5c449553
      Yves Senn 提交于
      This reverts deprecations added in #13528.
      The task is brought back for two reasons:
        1. Give plugins a way to hook into the test database initialization process
        2. Give the user a way to force a test database synchronization
      
      While `test:prepare` is still a dependency of every test task, `db:test:prepare`
      no longer hooks into it. This means that `test:prepare` runs before the schema
      is synchronized. Plugins, which insert data can now hook into `db:test:prepare`.
      
      The automatic schema maintenance can't detect when a migration is rolled-back,
      modified and reapplied. In this case the user has to fall back to `db:test:prepare`
      to force the synchronization to happen.
      5c449553
  12. 03 11月, 2014 2 次提交
  13. 29 9月, 2014 1 次提交
  14. 06 8月, 2014 1 次提交
    • Y
      schema rake tasks are specific about the configuration to act on. · f15cef67
      Yves Senn 提交于
      The rake tasks and the `DatabaseTakss` adapter classes used to
      assume a configuration at some places. This forced the rake
      tasks to establish a specific connection before calling into
      `load_schema`.
      
      After #15394 this started to cause issues because it could
      `purge` the wrong database before loading the schema.
      f15cef67
  15. 01 8月, 2014 1 次提交
  16. 28 6月, 2014 2 次提交
  17. 27 6月, 2014 10 次提交
  18. 17 6月, 2014 1 次提交
  19. 06 6月, 2014 1 次提交
  20. 27 5月, 2014 1 次提交
  21. 08 5月, 2014 1 次提交
  22. 03 5月, 2014 1 次提交
  23. 29 3月, 2014 1 次提交
  24. 20 3月, 2014 1 次提交
  25. 14 2月, 2014 1 次提交
  26. 06 2月, 2014 1 次提交
    • E
      Add config to disable schema dump after migration · 8806768e
      Emil Soman 提交于
      * Add a config on Active Record named `dump_schema_after_migration`
      * Schema dump doesn't happen if the config is set to false
      * Set default value of the config to true
      * Set config in generated production environment file to false
      * Update configuration guide
      * Update CHANGELOG
      8806768e
  27. 10 1月, 2014 1 次提交
    • S
      Ensure Active Record connection consistency · 6cc03675
      schneems 提交于
      Currently Active Record can be configured via the environment variable `DATABASE_URL` or by manually injecting a hash of values which is what Rails does, reading in `database.yml` and setting Active Record appropriately. Active Record expects to be able to use `DATABASE_URL` without the use of Rails, and we cannot rip out this functionality without deprecating. This presents a problem though when both config is set, and a `DATABASE_URL` is present. Currently the `DATABASE_URL` should "win" and none of the values in `database.yml` are used. This is somewhat unexpected to me if I were to set values such as `pool` in the `production:` group of `database.yml` they are ignored.
      
      There are many ways that active record initiates a connection today:
      
      - Stand Alone (without rails)
        - `rake db:<tasks>`
        - ActiveRecord.establish_connection
       
      - With Rails
        - `rake db:<tasks>`
        - `rails <server> | <console>`
        - `rails dbconsole`
      
      
      We should make all of these behave exactly the same way. The best way to do this is to put all of this logic in one place so it is guaranteed to be used.
      
      Here is my prosed matrix of how this behavior should work:
      
      ```
      No database.yml
      No DATABASE_URL
      => Error
      ```
      
      ```
      database.yml present
      No DATABASE_URL
      => Use database.yml configuration
      ```
      
      ```
      No database.yml
      DATABASE_URL present
      => use DATABASE_URL configuration
      ```
      
      ```
      database.yml present
      DATABASE_URL present
      => Merged into `url` sub key. If both specify `url` sub key, the `database.yml` `url`
         sub key "wins". If other paramaters `adapter` or `database` are specified in YAML,
         they are discarded as the `url` sub key "wins".
      ```
      
      ### Implementation
      
      Current implementation uses `ActiveRecord::Base.configurations` to resolve and merge all connection information before returning. This is achieved through a utility class: `ActiveRecord::ConnectionHandling::MergeAndResolveDefaultUrlConfig`.
      
      To understand the exact behavior of this class, it is best to review the behavior in activerecord/test/cases/connection_adapters/connection_handler_test.rb though it should match the above proposal.
      6cc03675
  28. 08 1月, 2014 1 次提交