mirror of
https://github.com/discourse/discourse.git
synced 2025-10-03 17:21:20 +08:00
First pass at converting and importing user customer fields linked to user fields Depends on https://github.com/discourse/discourse/pull/34739
34 lines
916 B
Ruby
34 lines
916 B
Ruby
# 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 UserFieldValue
|
|
SQL = <<~SQL
|
|
INSERT INTO user_field_values (
|
|
created_at,
|
|
field_id,
|
|
is_multiselect_field,
|
|
user_id,
|
|
value
|
|
)
|
|
VALUES (
|
|
?, ?, ?, ?, ?
|
|
)
|
|
SQL
|
|
private_constant :SQL
|
|
|
|
def self.create(created_at: nil, field_id:, is_multiselect_field: nil, user_id:, value: nil)
|
|
::Migrations::Database::IntermediateDB.insert(
|
|
SQL,
|
|
::Migrations::Database.format_datetime(created_at),
|
|
field_id,
|
|
::Migrations::Database.format_boolean(is_multiselect_field),
|
|
user_id,
|
|
value,
|
|
)
|
|
end
|
|
end
|
|
end
|