Welcome to mirror list, hosted at ThFree Co, Russian Federation.

extra_indexes.rb « validators « schema_validation « database « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c8d3749894b742fa1ba677098866c0eb91a36dc2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

module Gitlab
  module Database
    module SchemaValidation
      module Validators
        class ExtraIndexes < BaseValidator
          ERROR_MESSAGE = "The index %s is present in the database, but not in the structure.sql file"

          def execute
            database.indexes.filter_map do |database_index|
              next if structure_sql.index_exists?(database_index.name)

              build_inconsistency(self.class, nil, database_index)
            end
          end
        end
      end
    end
  end
end