mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-13 03:35:58 +08:00
* Splits the existing script into multiple classes * Adds command for generating IntermediateDB schema (`migrations/bin/cli schema generate`) * Changes the syntax of the IntermediateDB schema config * Adds validation for the schema config * It uses YAML schema aka JSON schema to validate the config file * It generates the SQL schema file and Ruby classes for storing data in the IntermediateDB
18 lines
342 B
Ruby
18 lines
342 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Migrations::Database::Schema::Validation
|
|
class BaseValidator
|
|
def initialize(config, errors, db)
|
|
@config = config
|
|
@schema_config ||= @config[:schema]
|
|
@errors = errors
|
|
@db = db
|
|
end
|
|
|
|
private
|
|
|
|
def sort_and_join(values)
|
|
values.sort.join(", ")
|
|
end
|
|
end
|
|
end
|