Use YAML file to define `gitlab_schema`
Today we use model.gitlab_schema = :gitlab_main/:gitlab_ci to indicate
the affinity of table for the purpose of cross-join and cross-modification detection.
Problem
This is proving hard to maintain, because:
- We have models that do not inherit from
ApplicationRecord - We have models that are nested in Background Migrations or regular migrations that are based on
ActiveRecord::Base - We have models that are polymorphic
- We might not have all models when needed which results in acceleration tables for mapping to not be fully accurate
Proposal
- Add a method that allows to read
gitlab_schemafrom YAML - Make code that uses schema to read gitlab_schema from YAML
- Remove
ActiveRecord::Base.gitlab_schemaas we should only map table names to schema - Remove old
gitlab_schema = :gitlab_main
Edited by Peter Leitzen