mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-06 16:50:46 +08:00
164 lines
4.7 KiB
Ruby
164 lines
4.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 Category
|
|
SQL = <<~SQL
|
|
INSERT INTO categories (
|
|
original_id,
|
|
about_topic_title,
|
|
all_topics_wiki,
|
|
allow_badges,
|
|
allow_global_tags,
|
|
allow_unlimited_owner_edits_on_first_post,
|
|
auto_close_based_on_last_post,
|
|
auto_close_hours,
|
|
color,
|
|
created_at,
|
|
default_list_filter,
|
|
default_slow_mode_seconds,
|
|
default_top_period,
|
|
default_view,
|
|
description,
|
|
email_in,
|
|
email_in_allow_strangers,
|
|
emoji,
|
|
existing_id,
|
|
icon,
|
|
locale,
|
|
mailinglist_mirror,
|
|
minimum_required_tags,
|
|
name,
|
|
navigate_to_first_post_after_read,
|
|
num_featured_topics,
|
|
parent_category_id,
|
|
position,
|
|
read_only_banner,
|
|
read_restricted,
|
|
search_priority,
|
|
show_subcategory_list,
|
|
slug,
|
|
sort_ascending,
|
|
sort_order,
|
|
style_type,
|
|
subcategory_list_style,
|
|
text_color,
|
|
topic_featured_link_allowed,
|
|
topic_id,
|
|
topic_template,
|
|
uploaded_background_dark_id,
|
|
uploaded_background_id,
|
|
uploaded_logo_dark_id,
|
|
uploaded_logo_id,
|
|
user_id
|
|
)
|
|
VALUES (
|
|
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?,
|
|
?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?
|
|
)
|
|
SQL
|
|
private_constant :SQL
|
|
|
|
def self.create(
|
|
original_id:,
|
|
about_topic_title: nil,
|
|
all_topics_wiki: nil,
|
|
allow_badges: nil,
|
|
allow_global_tags: nil,
|
|
allow_unlimited_owner_edits_on_first_post: nil,
|
|
auto_close_based_on_last_post: nil,
|
|
auto_close_hours: nil,
|
|
color: nil,
|
|
created_at: nil,
|
|
default_list_filter: nil,
|
|
default_slow_mode_seconds: nil,
|
|
default_top_period: nil,
|
|
default_view: nil,
|
|
description: nil,
|
|
email_in: nil,
|
|
email_in_allow_strangers: nil,
|
|
emoji: nil,
|
|
existing_id: nil,
|
|
icon: nil,
|
|
locale: nil,
|
|
mailinglist_mirror: nil,
|
|
minimum_required_tags: nil,
|
|
name:,
|
|
navigate_to_first_post_after_read: nil,
|
|
num_featured_topics: nil,
|
|
parent_category_id: nil,
|
|
position: nil,
|
|
read_only_banner: nil,
|
|
read_restricted: nil,
|
|
search_priority: nil,
|
|
show_subcategory_list: nil,
|
|
slug:,
|
|
sort_ascending: nil,
|
|
sort_order: nil,
|
|
style_type: nil,
|
|
subcategory_list_style: nil,
|
|
text_color: nil,
|
|
topic_featured_link_allowed: nil,
|
|
topic_id: nil,
|
|
topic_template: nil,
|
|
uploaded_background_dark_id: nil,
|
|
uploaded_background_id: nil,
|
|
uploaded_logo_dark_id: nil,
|
|
uploaded_logo_id: nil,
|
|
user_id:
|
|
)
|
|
::Migrations::Database::IntermediateDB.insert(
|
|
SQL,
|
|
original_id,
|
|
about_topic_title,
|
|
::Migrations::Database.format_boolean(all_topics_wiki),
|
|
::Migrations::Database.format_boolean(allow_badges),
|
|
::Migrations::Database.format_boolean(allow_global_tags),
|
|
::Migrations::Database.format_boolean(allow_unlimited_owner_edits_on_first_post),
|
|
::Migrations::Database.format_boolean(auto_close_based_on_last_post),
|
|
auto_close_hours,
|
|
color,
|
|
::Migrations::Database.format_datetime(created_at),
|
|
default_list_filter,
|
|
default_slow_mode_seconds,
|
|
default_top_period,
|
|
default_view,
|
|
description,
|
|
email_in,
|
|
::Migrations::Database.format_boolean(email_in_allow_strangers),
|
|
emoji,
|
|
existing_id,
|
|
icon,
|
|
locale,
|
|
::Migrations::Database.format_boolean(mailinglist_mirror),
|
|
minimum_required_tags,
|
|
name,
|
|
::Migrations::Database.format_boolean(navigate_to_first_post_after_read),
|
|
num_featured_topics,
|
|
parent_category_id,
|
|
position,
|
|
read_only_banner,
|
|
::Migrations::Database.format_boolean(read_restricted),
|
|
search_priority,
|
|
::Migrations::Database.format_boolean(show_subcategory_list),
|
|
slug,
|
|
::Migrations::Database.format_boolean(sort_ascending),
|
|
sort_order,
|
|
style_type,
|
|
subcategory_list_style,
|
|
text_color,
|
|
::Migrations::Database.format_boolean(topic_featured_link_allowed),
|
|
topic_id,
|
|
topic_template,
|
|
uploaded_background_dark_id,
|
|
uploaded_background_id,
|
|
uploaded_logo_dark_id,
|
|
uploaded_logo_id,
|
|
user_id,
|
|
)
|
|
end
|
|
end
|
|
end
|