Module: Gitlab::Database::LooseForeignKeys

Defined in:
lib/gitlab/database/loose_foreign_keys.rb

Class Method Summary collapse

Class Method Details

.definitionsObject



10
11
12
13
14
# File 'lib/gitlab/database/loose_foreign_keys.rb', line 10

def self.definitions
  @definitions ||= loose_foreign_keys_yaml.flat_map do |child_table_name, configs|
    configs.map { |config| build_definition(child_table_name, config) }
  end.freeze
end

.definitions_by_tableObject



6
7
8
# File 'lib/gitlab/database/loose_foreign_keys.rb', line 6

def self.definitions_by_table
  @definitions_by_table ||= definitions.group_by(&:to_table).with_indifferent_access.freeze
end

.loose_foreign_keys_yaml_pathObject



36
37
38
# File 'lib/gitlab/database/loose_foreign_keys.rb', line 36

def self.loose_foreign_keys_yaml_path
  @loose_foreign_keys_yaml_path ||= Rails.root.join('config/gitlab_loose_foreign_keys.yml')
end