discourse/migrations/lib/database/intermediate_db/user_custom_field.rb
Selase Krakani 964d2ebd23
DEV: Add support for converting and importing linked user_custom_fields (#34339)
First pass at converting and importing user customer fields linked to
user fields


Depends on https://github.com/discourse/discourse/pull/34739
2025-09-28 23:52:23 +00:00

32 lines
773 B
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 UserCustomField
SQL = <<~SQL
INSERT INTO user_custom_fields (
name,
user_id,
value,
created_at
)
VALUES (
?, ?, ?, ?
)
SQL
private_constant :SQL
def self.create(name:, user_id:, value:, created_at: nil)
::Migrations::Database::IntermediateDB.insert(
SQL,
name,
user_id,
value,
::Migrations::Database.format_datetime(created_at),
)
end
end
end