discourse/migrations/lib/database/intermediate_db/user_field.rb
Selase Krakani e7fe9f41b3
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
DEV: Sync IntermediateDB to support user_fields.show_on_signup (#34845)
Support newly added column on the `user_fields` core table
2025-09-24 17:28:28 +00:00

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