mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-04 06:55:00 +08:00
625 lines
17 KiB
YAML
625 lines
17 KiB
YAML
# $schema: ./json_schemas/db_schema.json
|
|
|
|
output:
|
|
schema_file: "db/intermediate_db_schema/100-base-schema.sql"
|
|
models_directory: "lib/database/intermediate_db"
|
|
models_namespace: Migrations::Database::IntermediateDB
|
|
enums_directory: "lib/database/intermediate_db/enums"
|
|
enums_namespace: Migrations::Database::IntermediateDB::Enums
|
|
|
|
schema:
|
|
tables:
|
|
badges:
|
|
columns:
|
|
add:
|
|
- name: "existing_id"
|
|
datatype: "numeric"
|
|
exclude:
|
|
- "grant_count"
|
|
- "system"
|
|
badge_groupings: { }
|
|
categories:
|
|
columns:
|
|
add:
|
|
- name: "about_topic_title"
|
|
datatype: text
|
|
- name: "existing_id"
|
|
datatype: numeric
|
|
exclude:
|
|
- "contains_messages"
|
|
- "latest_post_id"
|
|
- "latest_topic_id"
|
|
- "name_lower"
|
|
- "post_count"
|
|
- "posts_day"
|
|
- "posts_month"
|
|
- "posts_week"
|
|
- "posts_year"
|
|
- "topic_count"
|
|
- "topics_day"
|
|
- "topics_month"
|
|
- "topics_week"
|
|
- "topics_year"
|
|
- "reviewable_by_group_id"
|
|
category_users:
|
|
primary_key_column_names: [ "category_id", "user_id" ]
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
category_custom_fields:
|
|
primary_key_column_names: [ "category_id", "name" ]
|
|
columns:
|
|
exclude:
|
|
- "created_at"
|
|
- "id"
|
|
category_moderation_groups:
|
|
primary_key_column_names: [ "category_id", "group_id" ]
|
|
columns:
|
|
exclude:
|
|
- "created_at"
|
|
- "updated_at"
|
|
- "id"
|
|
group_users:
|
|
primary_key_column_names: [ "group_id", "user_id" ]
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
- "first_unread_pm_at"
|
|
groups:
|
|
columns:
|
|
add:
|
|
- name: "existing_id"
|
|
datatype: numeric
|
|
include:
|
|
- "allow_membership_requests"
|
|
- "allow_unknown_sender_topic_replies"
|
|
- "automatic_membership_email_domains"
|
|
- "bio_raw"
|
|
- "created_at"
|
|
- "default_notification_level"
|
|
- "flair_bg_color"
|
|
- "flair_color"
|
|
- "flair_icon"
|
|
- "flair_upload_id"
|
|
- "full_name"
|
|
- "grant_trust_level"
|
|
- "id"
|
|
- "members_visibility_level"
|
|
- "membership_request_template"
|
|
- "mentionable_level"
|
|
- "messageable_level"
|
|
- "name"
|
|
- "primary_group"
|
|
- "public_admission"
|
|
- "public_exit"
|
|
- "publish_read_state"
|
|
- "title"
|
|
- "visibility_level"
|
|
muted_users:
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
site_settings:
|
|
primary_key_column_names: [ "name" ]
|
|
columns:
|
|
include:
|
|
- "name"
|
|
- "value"
|
|
add:
|
|
- name: "import_mode"
|
|
enum: site_setting_import_mode
|
|
nullable: false
|
|
- name: "last_changed_at"
|
|
datatype: datetime
|
|
nullable: true
|
|
tag_group_memberships:
|
|
primary_key_column_names: [ "tag_group_id", "tag_id" ]
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
tag_group_permissions:
|
|
primary_key_column_names: [ "tag_group_id", "group_id", "permission_type" ]
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
tag_groups: { }
|
|
tag_users:
|
|
primary_key_column_names: [ "tag_id", "user_id" ]
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
tags:
|
|
columns:
|
|
exclude:
|
|
- "pm_topic_count"
|
|
- "public_topic_count"
|
|
- "staff_topic_count"
|
|
- "target_tag_id"
|
|
topic_allowed_groups:
|
|
primary_key_column_names: [ "topic_id", "group_id" ]
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
topic_allowed_users:
|
|
primary_key_column_names: [ "topic_id", "user_id" ]
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
topic_users:
|
|
primary_key_column_names: [ "topic_id", "user_id" ]
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
- "bookmarked"
|
|
- "liked"
|
|
- "posted"
|
|
topics:
|
|
columns:
|
|
exclude:
|
|
- "last_posted_at"
|
|
- "last_post_user_id"
|
|
- "reply_count"
|
|
- "featured_user1_id"
|
|
- "featured_user2_id"
|
|
- "featured_user3_id"
|
|
- "featured_user4_id"
|
|
- "image_upload_id"
|
|
- "highest_post_number"
|
|
- "like_count"
|
|
- "locale"
|
|
- "incoming_link_count"
|
|
- "moderator_posts_count"
|
|
- "bumped_at"
|
|
- "has_summary"
|
|
- "notify_moderators_count"
|
|
- "spam_count"
|
|
- "percent_rank"
|
|
- "posts_count"
|
|
- "score"
|
|
- "slug"
|
|
- "participant_count"
|
|
- "word_count"
|
|
- "excerpt"
|
|
- "fancy_title"
|
|
- "highest_staff_post_number"
|
|
- "reviewable_score"
|
|
- "slow_mode_seconds"
|
|
indexes:
|
|
- name: "index_topics_on_archetype"
|
|
columns: [ "archetype" ]
|
|
topic_tags:
|
|
primary_key_column_names: [ "topic_id", "tag_id" ]
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
user_associated_accounts:
|
|
primary_key_column_names: [ "user_id", "provider_name" ]
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
- "credentials"
|
|
- "extra"
|
|
modify:
|
|
- name: "last_used"
|
|
nullable: true
|
|
user_custom_fields:
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
primary_key_column_names: [ "user_id" , "name", "value" ]
|
|
user_emails:
|
|
columns:
|
|
include:
|
|
- "email"
|
|
- "primary"
|
|
- "user_id"
|
|
- "created_at"
|
|
primary_key_column_names: [ "user_id" , "email" ]
|
|
user_field_options:
|
|
primary_key_column_names: [ "user_field_id", "value" ]
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
user_field_values:
|
|
copy_of: user_custom_fields
|
|
columns:
|
|
exclude:
|
|
- "id"
|
|
- "name"
|
|
add:
|
|
- name: "field_id"
|
|
datatype: numeric
|
|
nullable: false
|
|
- name: "is_multiselect_field"
|
|
datatype: boolean
|
|
indexes:
|
|
- name: "user_field_values_multiselect_index"
|
|
columns: [ "user_id", "field_id", "value" ]
|
|
unique: true
|
|
condition: "WHERE is_multiselect_field = TRUE"
|
|
- name: "user_field_values_not_multiselect_index"
|
|
columns: [ "user_id", "field_id" ]
|
|
unique: true
|
|
condition: "WHERE is_multiselect_field = FALSE"
|
|
user_fields:
|
|
columns:
|
|
exclude:
|
|
- "field_type"
|
|
- "required"
|
|
user_options:
|
|
primary_key_column_names: [ "user_id" ]
|
|
users:
|
|
columns:
|
|
modify:
|
|
- name: "created_at"
|
|
nullable: false
|
|
add:
|
|
- name: "original_username"
|
|
datatype: text
|
|
- name: "avatar_type"
|
|
datatype: integer
|
|
exclude:
|
|
- "flag_level"
|
|
- "last_emailed_at"
|
|
- "last_posted_at"
|
|
- "last_seen_reviewable_id"
|
|
- "previous_visit_at"
|
|
- "required_fields_version"
|
|
- "secure_identifier"
|
|
- "seen_notification_id"
|
|
- "suspended_at"
|
|
- "suspended_till"
|
|
- "username_lower"
|
|
|
|
global:
|
|
columns:
|
|
modify:
|
|
- name: "id"
|
|
datatype: numeric
|
|
rename_to: "original_id"
|
|
- name: "created_at"
|
|
nullable: true
|
|
- name_regex: ".*upload.*_id$"
|
|
datatype: text
|
|
- name_regex: ".*_id$"
|
|
datatype: numeric
|
|
exclude:
|
|
- "updated_at"
|
|
|
|
tables:
|
|
exclude:
|
|
- "ad_plugin_house_ads"
|
|
- "ad_plugin_house_ads_categories"
|
|
- "ad_plugin_house_ads_groups"
|
|
- "ad_plugin_house_ads_routes"
|
|
- "ad_plugin_impressions"
|
|
- "admin_notices"
|
|
- "ai_agents"
|
|
- "ai_api_audit_logs"
|
|
- "ai_api_request_stats"
|
|
- "ai_artifact_key_values"
|
|
- "ai_artifact_versions"
|
|
- "ai_artifacts"
|
|
- "ai_document_fragments_embeddings"
|
|
- "ai_moderation_settings"
|
|
- "ai_posts_embeddings"
|
|
- "ai_secrets"
|
|
- "ai_spam_logs"
|
|
- "ai_summaries"
|
|
- "ai_tool_actions"
|
|
- "ai_tool_secret_bindings"
|
|
- "ai_tools"
|
|
- "ai_topics_embeddings"
|
|
- "allowed_pm_users"
|
|
- "anonymous_users"
|
|
- "api_key_scopes"
|
|
- "api_keys"
|
|
- "application_requests"
|
|
- "ar_internal_metadata"
|
|
- "assignments"
|
|
- "associated_groups"
|
|
- "backup_draft_posts"
|
|
- "backup_draft_topics"
|
|
- "backup_metadata"
|
|
- "badge_types"
|
|
- "bookmarks"
|
|
- "calendar_events"
|
|
- "categories_web_hooks"
|
|
- "category_featured_topics"
|
|
- "category_form_templates"
|
|
- "category_groups"
|
|
- "category_localizations"
|
|
- "category_posting_review_groups"
|
|
- "category_required_tag_groups"
|
|
- "category_search_data"
|
|
- "category_settings"
|
|
- "category_tag_groups"
|
|
- "category_tag_stats"
|
|
- "category_tags"
|
|
- "chat_channel_archives"
|
|
- "chat_channel_custom_fields"
|
|
- "chat_channels"
|
|
- "chat_drafts"
|
|
- "chat_mention_notifications"
|
|
- "chat_mentions"
|
|
- "chat_message_custom_fields"
|
|
- "chat_message_custom_prompts"
|
|
- "chat_message_interactions"
|
|
- "chat_message_links"
|
|
- "chat_message_reactions"
|
|
- "chat_message_revisions"
|
|
- "chat_message_search_data"
|
|
- "chat_messages"
|
|
- "chat_pinned_messages"
|
|
- "chat_thread_custom_fields"
|
|
- "chat_threads"
|
|
- "chat_webhook_events"
|
|
- "child_themes"
|
|
- "classification_results"
|
|
- "color_scheme_colors"
|
|
- "color_schemes"
|
|
- "completion_prompts"
|
|
- "custom_emojis"
|
|
- "data_explorer_queries"
|
|
- "data_explorer_query_groups"
|
|
- "developers"
|
|
- "direct_message_channels"
|
|
- "direct_message_users"
|
|
- "directory_columns"
|
|
- "directory_items"
|
|
- "discourse_automation_automations"
|
|
- "discourse_automation_fields"
|
|
- "discourse_automation_pending_automations"
|
|
- "discourse_automation_pending_pms"
|
|
- "discourse_automation_stats"
|
|
- "discourse_automation_user_global_notices"
|
|
- "discourse_calendar_disabled_holidays"
|
|
- "discourse_calendar_post_event_dates"
|
|
- "discourse_post_event_events"
|
|
- "discourse_post_event_invitees"
|
|
- "discourse_reactions_reaction_users"
|
|
- "discourse_reactions_reactions"
|
|
- "discourse_rss_polling_rss_feeds"
|
|
- "discourse_solved_solved_topics"
|
|
- "discourse_subscriptions_customers"
|
|
- "discourse_subscriptions_products"
|
|
- "discourse_subscriptions_subscriptions"
|
|
- "discourse_templates_usage_count"
|
|
- "dismissed_topic_users"
|
|
- "do_not_disturb_timings"
|
|
- "draft_sequences"
|
|
- "drafts"
|
|
- "email_change_requests"
|
|
- "email_logs"
|
|
- "email_tokens"
|
|
- "embeddable_host_tags"
|
|
- "embeddable_hosts"
|
|
- "embedding_definitions"
|
|
- "external_upload_stubs"
|
|
- "flags"
|
|
- "form_templates"
|
|
- "gamification_leaderboards"
|
|
- "gamification_score_events"
|
|
- "gamification_scores"
|
|
- "github_commits"
|
|
- "github_repos"
|
|
- "given_daily_likes"
|
|
- "group_archived_messages"
|
|
- "group_associated_groups"
|
|
- "group_category_notification_defaults"
|
|
- "group_custom_fields"
|
|
- "group_histories"
|
|
- "group_mentions"
|
|
- "group_requests"
|
|
- "group_tag_notification_defaults"
|
|
- "groups_web_hooks"
|
|
- "ignored_users"
|
|
- "incoming_chat_webhooks"
|
|
- "incoming_domains"
|
|
- "incoming_emails"
|
|
- "incoming_links"
|
|
- "incoming_referers"
|
|
- "inferred_concept_posts"
|
|
- "inferred_concept_topics"
|
|
- "inferred_concepts"
|
|
- "invited_groups"
|
|
- "invited_users"
|
|
- "invites"
|
|
- "javascript_caches"
|
|
- "linked_topics"
|
|
- "llm_credit_allocations"
|
|
- "llm_credit_daily_usages"
|
|
- "llm_feature_credit_costs"
|
|
- "llm_models"
|
|
- "llm_quota_usages"
|
|
- "llm_quotas"
|
|
- "message_bus"
|
|
- "model_accuracies"
|
|
- "moved_posts"
|
|
- "notifications"
|
|
- "oauth2_user_infos"
|
|
- "onceoff_logs"
|
|
- "optimized_images"
|
|
- "optimized_videos"
|
|
- "permalinks"
|
|
- "plugin_store_rows"
|
|
- "policy_users"
|
|
- "poll_options"
|
|
- "poll_votes"
|
|
- "polls"
|
|
- "post_action_types"
|
|
- "post_actions"
|
|
- "post_custom_fields"
|
|
- "post_custom_prompts"
|
|
- "post_details"
|
|
- "post_hotlinked_media"
|
|
- "post_localizations"
|
|
- "post_policies"
|
|
- "post_policy_groups"
|
|
- "post_replies"
|
|
- "post_reply_keys"
|
|
- "post_revisions"
|
|
- "post_search_data"
|
|
- "post_stats"
|
|
- "post_timings"
|
|
- "post_voting_comment_custom_fields"
|
|
- "post_voting_comments"
|
|
- "post_voting_votes"
|
|
- "posts"
|
|
- "problem_check_trackers"
|
|
- "published_pages"
|
|
- "push_subscriptions"
|
|
- "quoted_posts"
|
|
- "rag_document_fragments"
|
|
- "redelivering_webhook_events"
|
|
- "remote_themes"
|
|
- "reviewable_claimed_topics"
|
|
- "reviewable_histories"
|
|
- "reviewable_notes"
|
|
- "reviewable_scores"
|
|
- "reviewables"
|
|
- "scheduler_stats"
|
|
- "schema_migration_details"
|
|
- "schema_migrations"
|
|
- "screened_emails"
|
|
- "screened_ip_addresses"
|
|
- "screened_urls"
|
|
- "search_logs"
|
|
- "shared_ai_conversations"
|
|
- "shared_drafts"
|
|
- "shelved_notifications"
|
|
- "sidebar_section_links"
|
|
- "sidebar_sections"
|
|
- "sidebar_urls"
|
|
- "silenced_assignments"
|
|
- "single_sign_on_records"
|
|
- "site_setting_groups"
|
|
- "sitemaps"
|
|
- "skipped_email_logs"
|
|
- "stylesheet_cache"
|
|
- "summary_sections"
|
|
- "tag_localizations"
|
|
- "tag_search_data"
|
|
- "tags_web_hooks"
|
|
- "theme_fields"
|
|
- "theme_modifier_sets"
|
|
- "theme_settings"
|
|
- "theme_settings_migrations"
|
|
- "theme_site_settings"
|
|
- "theme_svg_sprites"
|
|
- "theme_translation_overrides"
|
|
- "themes"
|
|
- "top_topics"
|
|
- "topic_custom_fields"
|
|
- "topic_embeds"
|
|
- "topic_groups"
|
|
- "topic_hot_scores"
|
|
- "topic_invites"
|
|
- "topic_link_clicks"
|
|
- "topic_links"
|
|
- "topic_localizations"
|
|
- "topic_search_data"
|
|
- "topic_thumbnails"
|
|
- "topic_timers"
|
|
- "topic_view_stats"
|
|
- "topic_views"
|
|
- "topic_voting_category_settings"
|
|
- "topic_voting_topic_vote_count"
|
|
- "topic_voting_votes"
|
|
- "translation_overrides"
|
|
- "unsubscribe_keys"
|
|
- "upcoming_change_events"
|
|
- "upload_references"
|
|
- "uploads"
|
|
- "user_actions"
|
|
- "user_api_key_client_scopes"
|
|
- "user_api_key_clients"
|
|
- "user_api_key_scopes"
|
|
- "user_api_keys"
|
|
- "user_archived_messages"
|
|
- "user_associated_groups"
|
|
- "user_auth_token_logs"
|
|
- "user_auth_tokens"
|
|
- "user_avatars"
|
|
- "user_badges"
|
|
- "user_chat_channel_memberships"
|
|
- "user_chat_thread_memberships"
|
|
- "user_exports"
|
|
- "user_histories"
|
|
- "user_ip_address_histories"
|
|
- "user_notification_schedules"
|
|
- "user_open_ids"
|
|
- "user_passwords"
|
|
- "user_profile_views"
|
|
- "user_profiles"
|
|
- "user_required_fields_versions"
|
|
- "user_search_data"
|
|
- "user_second_factors"
|
|
- "user_security_keys"
|
|
- "user_stats"
|
|
- "user_statuses"
|
|
- "user_uploads"
|
|
- "user_visits"
|
|
- "user_warnings"
|
|
- "watched_word_groups"
|
|
- "watched_words"
|
|
- "web_crawler_requests"
|
|
- "web_hook_event_types"
|
|
- "web_hook_event_types_hooks"
|
|
- "web_hook_events"
|
|
- "web_hook_events_daily_aggregates"
|
|
- "web_hooks"
|
|
|
|
enums:
|
|
site_setting_import_mode:
|
|
values:
|
|
- auto
|
|
- override
|
|
- append
|
|
site_setting_datatype:
|
|
source: "::SiteSettings::TypeSupervisor.types"
|
|
|
|
plugins:
|
|
- "automation"
|
|
- "chat"
|
|
- "checklist"
|
|
- "discourse-adplugin"
|
|
- "discourse-affiliate"
|
|
- "discourse-ai"
|
|
- "discourse-apple-auth"
|
|
- "discourse-assign"
|
|
- "discourse-cakeday"
|
|
- "discourse-calendar"
|
|
- "discourse-chat-integration"
|
|
- "discourse-data-explorer"
|
|
- "discourse-details"
|
|
- "discourse-gamification"
|
|
- "discourse-github"
|
|
- "discourse-graphviz"
|
|
- "discourse-hcaptcha"
|
|
- "discourse-lazy-videos"
|
|
- "discourse-local-dates"
|
|
- "discourse-login-with-amazon"
|
|
- "discourse-lti"
|
|
- "discourse-math"
|
|
- "discourse-microsoft-auth"
|
|
- "discourse-narrative-bot"
|
|
- "discourse-oauth2-basic"
|
|
- "discourse-openid-connect"
|
|
- "discourse-patreon"
|
|
- "discourse-policy"
|
|
- "discourse-post-voting"
|
|
- "discourse-presence"
|
|
- "discourse-reactions"
|
|
- "discourse-rewind"
|
|
- "discourse-rss-polling"
|
|
- "discourse-solved"
|
|
- "discourse-subscriptions"
|
|
- "discourse-templates"
|
|
- "discourse-topic-voting"
|
|
- "discourse-user-notes"
|
|
- "discourse-zendesk-plugin"
|
|
- "footnote"
|
|
- "poll"
|
|
- "spoiler-alert"
|
|
- "styleguide"
|