blob: 2478d446e43733ae0b962b85daeb0da16d2eab56 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# frozen_string_literal: true
module Gitlab
module Database
module SchemaValidation
module Validators
class BaseValidator
Inconsistency = Struct.new(:name, :statement)
def initialize(structure_sql, database)
@structure_sql = structure_sql
@database = database
end
def self.all_validators
[
ExtraIndexes,
MissingIndexes,
WrongIndexes
]
end
def execute
raise NoMethodError, "subclasses of #{self.class.name} must implement #{__method__}"
end
private
attr_reader :structure_sql, :database
def build_inconsistency(schema_object)
Inconsistency.new(schema_object.name, schema_object.statement)
end
end
end
end
end
end
|