debian-mirror-gitlab/lib/gitlab/database/schema_validation/runner.rb
2023-05-27 22:25:52 +05:30

23 lines
546 B
Ruby

# frozen_string_literal: true
module Gitlab
module Database
module SchemaValidation
class Runner
def initialize(structure_sql, database, validators: Validators::BaseValidator.all_validators)
@structure_sql = structure_sql
@database = database
@validators = validators
end
def execute
validators.flat_map { |c| c.new(structure_sql, database).execute }
end
private
attr_reader :structure_sql, :database, :validators
end
end
end
end