mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-12 20:48:11 +08:00
37 lines
977 B
Ruby
37 lines
977 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 TopicAllowedUser
|
|
SQL = <<~SQL
|
|
INSERT INTO topic_allowed_users (
|
|
topic_id,
|
|
user_id,
|
|
created_at
|
|
)
|
|
VALUES (
|
|
?, ?, ?
|
|
)
|
|
SQL
|
|
private_constant :SQL
|
|
|
|
# Creates a new `topic_allowed_users` record in the IntermediateDB.
|
|
#
|
|
# @param topic_id [Integer, String]
|
|
# @param user_id [Integer, String]
|
|
# @param created_at [Time, nil]
|
|
#
|
|
# @return [void]
|
|
def self.create(topic_id:, user_id:, created_at: nil)
|
|
::Migrations::Database::IntermediateDB.insert(
|
|
SQL,
|
|
topic_id,
|
|
user_id,
|
|
::Migrations::Database.format_datetime(created_at),
|
|
)
|
|
end
|
|
end
|
|
end
|