mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-21 01:53:41 +08:00
The import is split into basic site settings (imported at the beginning) and settings that depend on other data
43 lines
1.2 KiB
Ruby
Vendored
43 lines
1.2 KiB
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
# This file is auto-generated from the IntermediateDB schema. To make changes,
|
|
# update the "config/intermediate_db.yml" configuration file and then run
|
|
# `bin/cli schema generate` to regenerate this file.
|
|
|
|
module Migrations::Database::IntermediateDB
|
|
module SiteSetting
|
|
SQL = <<~SQL
|
|
INSERT INTO site_settings (
|
|
name,
|
|
import_mode,
|
|
last_changed_at,
|
|
value
|
|
)
|
|
VALUES (
|
|
?, ?, ?, ?
|
|
)
|
|
SQL
|
|
private_constant :SQL
|
|
|
|
# Creates a new `site_settings` record in the IntermediateDB.
|
|
#
|
|
# @param name [String]
|
|
# @param import_mode [Integer]
|
|
# Any constant from SiteSettingImportMode (e.g. SiteSettingImportMode::AUTO)
|
|
# @param last_changed_at [Time, nil]
|
|
# @param value [String, nil]
|
|
#
|
|
# @return [void]
|
|
#
|
|
# @see Migrations::Database::IntermediateDB::Enums::SiteSettingImportMode
|
|
def self.create(name:, import_mode:, last_changed_at: nil, value: nil)
|
|
::Migrations::Database::IntermediateDB.insert(
|
|
SQL,
|
|
name,
|
|
import_mode,
|
|
::Migrations::Database.format_datetime(last_changed_at),
|
|
value,
|
|
)
|
|
end
|
|
end
|
|
end
|