1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/cases/tasks
Katrina Owen 2c2ff8228e
Allow schema cache path to be defined in the config file
This updates the database tasks for dumping the Active Record schema cache as
well as clearing the schema cache file, allowing the path to be defined in the
database configuration YAML file.

As before, the value can also be defined in an ENV variable, though this would
not work for a multi-db application. If the value is specified neither in the
DB config, nor in the ENV, then the path will continue to be derived from the
DB config spec_name.

Note that in order to make this change cleaner I also moved a bit of logic
out of a rake task and into the DatabaseTasks class, for symmetry.

We have two rake tasks for the schema cache:

    $ rake db:schema:cache:dump
    $ rake db:schema:cache:clear

The cache:dump task was implemented in DatabaseTasks, but the
cache:clear one was not.

I also added some tests for the behavior that I was changing, since some of
the code paths weren't tested.
2020-01-23 08:18:23 -07:00
..
database_tasks_test.rb Allow schema cache path to be defined in the config file 2020-01-23 08:18:23 -07:00
mysql_rake_test.rb Make DatabaseTasks adapters use DatabaseConfig objects 2019-09-25 13:52:14 -04:00
postgresql_rake_test.rb Update tests 2020-01-06 20:43:20 +03:00
sqlite_rake_test.rb Make DatabaseTasks adapters use DatabaseConfig objects 2019-09-25 13:52:14 -04:00