mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-05 19:11:00 +08:00
Some checks failed
Tests / themes system (push) Has been cancelled
Licenses / run (push) Has been cancelled
Linting / run (push) Has been cancelled
Migration Tests / Tests (push) Has been cancelled
Publish Assets / publish-assets (push) Has been cancelled
Tests / core backend (push) Has been cancelled
Tests / plugins backend (push) Has been cancelled
Tests / core frontend (Chrome) (push) Has been cancelled
Tests / plugins frontend (push) Has been cancelled
Tests / themes frontend (push) Has been cancelled
Tests / core system (push) Has been cancelled
Tests / plugins system (push) Has been cancelled
Tests / core frontend (Firefox ESR) (push) Has been cancelled
Tests / core frontend (Firefox Evergreen) (push) Has been cancelled
Tests / chat system (push) Has been cancelled
Tests / merge (push) Has been cancelled
Support newly added column on the `user_fields` core table
67 lines
1.7 KiB
Ruby
67 lines
1.7 KiB
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 UserField
|
|
SQL = <<~SQL
|
|
INSERT INTO user_fields (
|
|
original_id,
|
|
created_at,
|
|
description,
|
|
editable,
|
|
external_name,
|
|
external_type,
|
|
field_type_enum,
|
|
name,
|
|
position,
|
|
requirement,
|
|
searchable,
|
|
show_on_profile,
|
|
show_on_signup,
|
|
show_on_user_card
|
|
)
|
|
VALUES (
|
|
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
|
|
)
|
|
SQL
|
|
private_constant :SQL
|
|
|
|
def self.create(
|
|
original_id:,
|
|
created_at: nil,
|
|
description:,
|
|
editable: nil,
|
|
external_name: nil,
|
|
external_type: nil,
|
|
field_type_enum:,
|
|
name:,
|
|
position: nil,
|
|
requirement: nil,
|
|
searchable: nil,
|
|
show_on_profile: nil,
|
|
show_on_signup: nil,
|
|
show_on_user_card: nil
|
|
)
|
|
::Migrations::Database::IntermediateDB.insert(
|
|
SQL,
|
|
original_id,
|
|
::Migrations::Database.format_datetime(created_at),
|
|
description,
|
|
::Migrations::Database.format_boolean(editable),
|
|
external_name,
|
|
external_type,
|
|
field_type_enum,
|
|
name,
|
|
position,
|
|
requirement,
|
|
::Migrations::Database.format_boolean(searchable),
|
|
::Migrations::Database.format_boolean(show_on_profile),
|
|
::Migrations::Database.format_boolean(show_on_signup),
|
|
::Migrations::Database.format_boolean(show_on_user_card),
|
|
)
|
|
end
|
|
end
|
|
end
|