Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to ignore tables in the schema cache
In cases where an application uses pt-osc or lhm they may have temporary tables being used for migrations. Those tables shouldn't be included by the schema cache because it makes the cache bigger and those tables shouldn't ever be queried by the application. This feature allows applications to configure a list of or regex of tables to ignore. The behavior for ignored tables for each method in the schema cache (`columns`, `columns_hash`, `primary_keys`, and `indexes`) matches the behavior of a non-existent table. `columns` and `columns_hash` will raise a database not found error, `primary_keys` will return `nil`. and `indexes` will return an empty array. See #43105 which make behavior across adapters consistent. To use in an application configure `config.active_record.schema_cache_ignored_tables` to an array of tables or regex's. Those tables will not be included in the schema cache dump.
- Loading branch information
1 parent
1b2fa18
commit e3b4a46
Showing
4 changed files
with
82 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters