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

extra_indexes.rb « validators « validation « schema « gitlab « lib « gitlab-schema-validation « gems - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4b5bd7c820bf9d9776a586fca788a85361910c01 (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 Schema
    module Validation
      module Validators
        class ExtraIndexes < Base
          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