Skip to content

A platform for community discussion. Free, open, simple.

DEV: Improve separation of core and plugin CI (#33583)

Jarek Radosz378bed012c89
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index f5dd49c12c0..401c6edb8da 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -46,6 +46,7 @@ jobs:
TESTEM_BROWSER: ${{ (startsWith(matrix.browser, 'Firefox') && 'Firefox') || matrix.browser }}
TESTEM_FIREFOX_PATH: ${{ (matrix.browser == 'Firefox Evergreen') && '/opt/firefox-evergreen/firefox' }}
EMBER_ENV: development
+ LOAD_PLUGINS: ${{ (matrix.target == 'plugins' || matrix.target == 'chat') && '1' || '0' }}
strategy:
fail-fast: false
@@ -171,6 +172,7 @@ jobs:
${{ hashFiles('.github/workflows/tests.yml') }}-
${{ hashFiles('db/**/*', 'plugins/**/db/**/*') }}-
${{ hashFiles('config/environments/test.rb') }}-
+ ${{ env.LOAD_PLUGINS }}-
${{ env.USES_PARALLEL_DATABASES }}-
${{ env.PARALLEL_TEST_PROCESSORS }}-
@@ -214,25 +216,31 @@ jobs:
restore-keys: rspec-runtime-${{ matrix.build_type }}-${{ matrix.target }}-
- name: Check Annotations
- if: matrix.build_type == 'backend' && matrix.target == 'core'
+ if: matrix.build_type == 'backend' && (matrix.target == 'core' || matrix.target == 'plugins' || matrix.target == 'chat')
run: |
bin/rake annotate:ensure_all_indexes
- bin/annotate --models --model-dir app/models
- if [ ! -z "$(git status --porcelain app/models/)" ]; then
+ directories=""
+ if [ "${{ matrix.target }}" = "core" ]; then
+ directories="app/models"
+ else
+ directories="$(script/list_bundled_plugins | xargs -I{} find {} -type d -path '*/app/models' -maxdepth 3)"
+ fi
+
+ bin/annotate --models --model-dir $(echo "${directories}" | tr '\n' ',')
+
+ if [ ! -z "$(git status --porcelain ${directories})" ]; then
echo "Core annotations are not up to date. To resolve, run:"
echo " bin/rake annotate:clean"
echo
echo "Or manually apply the diff printed below:"
echo "---------------------------------------------"
- git -c color.ui=always diff app/models/
+ git -c color.ui=always diff ${directories}
exit 1
fi
- name: Check Zeitwerk reloading
if: matrix.build_type == 'backend'
- env:
- LOAD_PLUGINS: ${{ (matrix.target == 'plugins') && '1' || '0' }}
run: |
if ! bin/rails runner 'Rails.application.reloader.reload!'; then
echo
@@ -246,8 +254,6 @@ jobs:
- name: Check SKIP_DB_AND_REDIS bootability
if: matrix.build_type == 'backend'
- env:
- LOAD_PLUGINS: ${{ (matrix.target == 'plugins') && '1' || '0' }}
run: |
if ! (SKIP_DB_AND_REDIS=1 DISCOURSE_DEV_DB="nonexist" bin/rails runner "puts 'booted successfully'"); then
echo
@@ -304,14 +310,14 @@ jobs:
env:
CHECKOUT_TIMEOUT: 10
run: |
- LOAD_PLUGINS=1 RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error bin/turbo_rspec --exclude-pattern="plugins/chat/*" --use-runtime-info --profile=50 --verbose --format documentation plugins/*/spec/system
+ RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error bin/turbo_rspec --exclude-pattern="plugins/chat/*" --use-runtime-info --profile=50 --verbose --format documentation plugins/*/spec/system
shell: bash
- name: Chat System Tests
if: matrix.build_type == 'system' && matrix.target == 'chat'
env:
CHECKOUT_TIMEOUT: 10
- run: LOAD_PLUGINS=1 RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error bin/turbo_rspec --use-runtime-info --profile=50 --verbose --format documentation plugins/chat/spec/system
+ run: RAILS_ENABLE_TEST_LOG=1 RAILS_TEST_LOG_LEVEL=error bin/turbo_rspec --use-runtime-info --profile=50 --verbose --format documentation plugins/chat/spec/system
- name: Theme System Tests
if: matrix.build_type == 'system' && matrix.target == 'themes'
diff --git a/app/models/post_custom_field.rb b/app/models/post_custom_field.rb
index 750dc2fe9c5..91384800b96 100644
--- a/app/models/post_custom_field.rb
+++ b/app/models/post_custom_field.rb
@@ -19,10 +19,9 @@ end
#
# Indexes
#
-# index_post_custom_fields_on_name_and_value (name, "left"(value, 200))
-# index_post_custom_fields_on_notice (post_id) UNIQUE WHERE ((name)::text = 'notice'::text)
-# index_post_custom_fields_on_post_id (post_id) UNIQUE WHERE ((name)::text = 'missing uploads'::text)
-# index_post_custom_fields_on_post_id_and_name (post_id,name)
-# index_post_custom_fields_on_stalled_wiki_triggered_at (post_id) UNIQUE WHERE ((name)::text = 'stalled_wiki_triggered_at'::text)
-# index_post_id_where_missing_uploads_ignored (post_id) UNIQUE WHERE ((name)::text = 'missing uploads ignored'::text)
+# index_post_custom_fields_on_name_and_value (name, "left"(value, 200))
+# index_post_custom_fields_on_notice (post_id) UNIQUE WHERE ((name)::text = 'notice'::text)
+# index_post_custom_fields_on_post_id (post_id) UNIQUE WHERE ((name)::text = 'missing uploads'::text)
+# index_post_custom_fields_on_post_id_and_name (post_id,name)
+# index_post_id_where_missing_uploads_ignored (post_id) UNIQUE WHERE ((name)::text = 'missing uploads ignored'::text)
#
diff --git a/app/models/topic_custom_field.rb b/app/models/topic_custom_field.rb
index 1c5ba784e95..6a8a799bad3 100644
--- a/app/models/topic_custom_field.rb
+++ b/app/models/topic_custom_field.rb
@@ -19,7 +19,6 @@ end
#
# Indexes
#
-# idx_topic_custom_fields_auto_responder_triggered_ids_partial (topic_id,value) UNIQUE WHERE ((name)::text = 'auto_responder_triggered_ids'::text)
-# index_topic_custom_fields_on_topic_id_and_name (topic_id,name)
-# topic_custom_fields_value_key_idx (value,name) WHERE ((value IS NOT NULL) AND (char_length(value) < 400))
+# index_topic_custom_fields_on_topic_id_and_name (topic_id,name)
+# topic_custom_fields_value_key_idx (value,name) WHERE ((value IS NOT NULL) AND (char_length(value) < 400))
#
diff --git a/app/models/user_option.rb b/app/models/user_option.rb
index 9e10132c216..53a1c17b121 100644
--- a/app/models/user_option.rb
+++ b/app/models/user_option.rb
@@ -244,64 +244,51 @@ end
#
# Table name: user_options
#
-# user_id :integer not null, primary key
-# mailing_list_mode :boolean default(FALSE), not null
-# email_digests :boolean
-# external_links_in_new_tab :boolean default(FALSE), not null
-# enable_quoting :boolean default(TRUE), not null
-# dynamic_favicon :boolean default(FALSE), not null
-# automatically_unpin_topics :boolean default(TRUE), not null
-# digest_after_minutes :integer
-# auto_track_topics_after_msecs :integer
-# new_topic_duration_minutes :integer
-# last_redirected_to_top_at :datetime
-# email_previous_replies :integer default(2), not null
-# email_in_reply_to :boolean default(TRUE), not null
-# like_notification_frequency :integer default(1), not null
-# mailing_list_mode_frequency :integer default(1), not null
-# include_tl0_in_digests :boolean default(FALSE)
-# notification_level_when_replying :integer
-# theme_key_seq :integer default(0), not null
-# allow_private_messages :boolean default(TRUE), not null
-# homepage_id :integer
-# theme_ids :integer default([]), not null, is an Array
-# hide_profile_and_presence :boolean default(FALSE), not null
-# text_size_key :integer default(0), not null
-# text_size_seq :integer default(0), not null
-# email_level :integer default(1), not null
-# email_messages_level :integer default(0), not null
-# title_count_mode_key :integer default(0), not null
-# enable_defer :boolean default(FALSE), not null
-# timezone :string
-# enable_allowed_pm_users :boolean default(FALSE), not null
-# dark_scheme_id :integer
-# skip_new_user_tips :boolean default(FALSE), not null
-# color_scheme_id :integer
-# default_calendar :integer default("none_selected"), not null
-# chat_enabled :boolean default(TRUE), not null
-# only_chat_push_notifications :boolean
-# oldest_search_log_date :datetime
-# chat_sound :string
-# dismissed_channel_retention_reminder :boolean
-# dismissed_dm_retention_reminder :boolean
-# bookmark_auto_delete_preference :integer default(3), not null
-# ignore_channel_wide_mention :boolean
-# chat_email_frequency :integer default(1), not null
-# enable_experimental_sidebar :boolean default(FALSE)
-# seen_popups :integer is an Array
-# chat_header_indicator_preference :integer default(0), not null
-# sidebar_link_to_filtered_list :boolean default(FALSE), not null
-# sidebar_show_count_of_new_items :boolean default(FALSE), not null
-# watched_precedence_over_muted :boolean
-# chat_separate_sidebar_mode :integer default(0), not null
-# topics_unread_when_closed :boolean default(TRUE), not null
-# show_thread_title_prompts :boolean default(TRUE), not null
-# enable_smart_lists :boolean default(TRUE), not null
-# hide_profile :boolean default(FALSE), not null
-# hide_presence :boolean default(FALSE), not null
-# chat_send_shortcut :integer default(0), not null
-# chat_quick_reaction_type :integer default(0), not null
-# chat_quick_reactions_custom :string
+# user_id :integer not null, primary key
+# mailing_list_mode :boolean default(FALSE), not null
+# email_digests :boolean
+# external_links_in_new_tab :boolean default(FALSE), not null
+# enable_quoting :boolean default(TRUE), not null
+# dynamic_favicon :boolean default(FALSE), not null
+# automatically_unpin_topics :boolean default(TRUE), not null
+# digest_after_minutes :integer
+# auto_track_topics_after_msecs :integer
+# new_topic_duration_minutes :integer
+# last_redirected_to_top_at :datetime
+# email_previous_replies :integer default(2), not null
+# email_in_reply_to :boolean default(TRUE), not null
+# like_notification_frequency :integer default(1), not null
+# mailing_list_mode_frequency :integer default(1), not null
+# include_tl0_in_digests :boolean default(FALSE)
+# notification_level_when_replying :integer
+# theme_key_seq :integer default(0), not null
+# allow_private_messages :boolean default(TRUE), not null
+# homepage_id :integer
+# theme_ids :integer default([]), not null, is an Array
+# hide_profile_and_presence :boolean default(FALSE), not null
+# text_size_key :integer default(0), not null
+# text_size_seq :integer default(0), not null
+# email_level :integer default(1), not null
+# email_messages_level :integer default(0), not null
+# title_count_mode_key :integer default(0), not null
+# enable_defer :boolean default(FALSE), not null
+# timezone :string
+# enable_allowed_pm_users :boolean default(FALSE), not null
+# dark_scheme_id :integer
+# skip_new_user_tips :boolean default(FALSE), not null
+# color_scheme_id :integer
+# default_calendar :integer default("none_selected"), not null
+# oldest_search_log_date :datetime
+# bookmark_auto_delete_preference :integer default(3), not null
+# enable_experimental_sidebar :boolean default(FALSE)
+# seen_popups :integer is an Array
+# sidebar_link_to_filtered_list :boolean default(FALSE), not null
+# sidebar_show_count_of_new_items :boolean default(FALSE), not null
+# watched_precedence_over_muted :boolean
+# topics_unread_when_closed :boolean default(TRUE), not null
+# enable_smart_lists :boolean default(TRUE), not null
+# hide_profile :boolean default(FALSE), not null
+# hide_presence :boolean default(FALSE), not null
#
# Indexes
#
diff --git a/plugins/chat/app/models/chat/all_mention.rb b/plugins/chat/app/models/chat/all_mention.rb
index 01a1c4c7295..7094465f881 100644
--- a/plugins/chat/app/models/chat/all_mention.rb
+++ b/plugins/chat/app/models/chat/all_mention.rb
@@ -4,3 +4,20 @@ module Chat
class AllMention < Mention
end
end
+
+# == Schema Information
+#
+# Table name: chat_mentions
+#
+# id :bigint not null, primary key
+# chat_message_id :bigint not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# type :string not null
+# target_id :integer
+#
+# Indexes
+#
+# index_chat_mentions_on_chat_message_id (chat_message_id)
+# index_chat_mentions_on_target_id (target_id)
+#
diff --git a/plugins/chat/app/models/chat/category_channel.rb b/plugins/chat/app/models/chat/category_channel.rb
index cea3ab6277f..48c3e779b2e 100644
--- a/plugins/chat/app/models/chat/category_channel.rb
+++ b/plugins/chat/app/models/chat/category_channel.rb
@@ -30,3 +30,40 @@ module Chat
end
end
end
+
+# == Schema Information
+#
+# Table name: chat_channels
+#
+# id :bigint not null, primary key
+# chatable_id :bigint not null
+# deleted_at :datetime
+# deleted_by_id :integer
+# featured_in_category_id :integer
+# delete_after_seconds :integer
+# chatable_type :string not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# name :string
+# description :text
+# status :integer default("open"), not null
+# user_count :integer default(0), not null
+# auto_join_users :boolean default(FALSE), not null
+# user_count_stale :boolean default(FALSE), not null
+# slug :string
+# type :string
+# allow_channel_wide_mentions :boolean default(TRUE), not null
+# messages_count :integer default(0), not null
+# threading_enabled :boolean default(FALSE), not null
+# last_message_id :bigint
+# icon_upload_id :integer
+#
+# Indexes
+#
+# index_chat_channels_on_chatable_id (chatable_id)
+# index_chat_channels_on_chatable_id_and_chatable_type (chatable_id,chatable_type)
+# index_chat_channels_on_last_message_id (last_message_id)
+# index_chat_channels_on_messages_count (messages_count)
+# index_chat_channels_on_slug (slug) UNIQUE WHERE ((slug)::text <> ''::text)
+# index_chat_channels_on_status (status)
+#
diff --git a/plugins/chat/app/models/chat/channel.rb b/plugins/chat/app/models/chat/channel.rb
index 29b8a0f5a5c..1078acf4066 100644
--- a/plugins/chat/app/models/chat/channel.rb
+++ b/plugins/chat/app/models/chat/channel.rb
@@ -291,7 +291,7 @@ end
# Table name: chat_channels
#
# id :bigint not null, primary key
-# chatable_id :integer not null
+# chatable_id :bigint not null
# deleted_at :datetime
# deleted_by_id :integer
# featured_in_category_id :integer
@@ -305,8 +305,8 @@ end
# user_count :integer default(0), not null
# auto_join_users :boolean default(FALSE), not null
# user_count_stale :boolean default(FALSE), not null
-# type :string
# slug :string
+# type :string
# allow_channel_wide_mentions :boolean default(TRUE), not null
# messages_count :integer default(0), not null
# threading_enabled :boolean default(FALSE), not null
diff --git a/plugins/chat/app/models/chat/direct_message.rb b/plugins/chat/app/models/chat/direct_message.rb
index 47e28025703..097306c435e 100644
--- a/plugins/chat/app/models/chat/direct_message.rb
+++ b/plugins/chat/app/models/chat/direct_message.rb
@@ -94,7 +94,7 @@ end
# Table name: direct_message_channels
#
# id :bigint not null, primary key
-# group :boolean
# created_at :datetime not null
# updated_at :datetime not null
+# group :boolean default(FALSE), not null
#
diff --git a/plugins/chat/app/models/chat/direct_message_channel.rb b/plugins/chat/app/models/chat/direct_message_channel.rb
index 3e134725a80..bb7e1b3b7fc 100644
--- a/plugins/chat/app/models/chat/direct_message_channel.rb
+++ b/plugins/chat/app/models/chat/direct_message_channel.rb
@@ -40,3 +40,40 @@ module Chat
end
end
end
+
+# == Schema Information
+#
+# Table name: chat_channels
+#
+# id :bigint not null, primary key
+# chatable_id :bigint not null
+# deleted_at :datetime
+# deleted_by_id :integer
+# featured_in_category_id :integer
+# delete_after_seconds :integer
+# chatable_type :string not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# name :string
+# description :text
+# status :integer default("open"), not null
+# user_count :integer default(0), not null
+# auto_join_users :boolean default(FALSE), not null
+# user_count_stale :boolean default(FALSE), not null
+# slug :string
+# type :string
+# allow_channel_wide_mentions :boolean default(TRUE), not null
+# messages_count :integer default(0), not null
+# threading_enabled :boolean default(FALSE), not null
+# last_message_id :bigint
+# icon_upload_id :integer
+#
+# Indexes
+#
+# index_chat_channels_on_chatable_id (chatable_id)
+# index_chat_channels_on_chatable_id_and_chatable_type (chatable_id,chatable_type)
+# index_chat_channels_on_last_message_id (last_message_id)
+# index_chat_channels_on_messages_count (messages_count)
+# index_chat_channels_on_slug (slug) UNIQUE WHERE ((slug)::text <> ''::text)
+# index_chat_channels_on_status (status)
+#
diff --git a/plugins/chat/app/models/chat/direct_message_user.rb b/plugins/chat/app/models/chat/direct_message_user.rb
index aae155f6210..bf4f859a4ba 100644
--- a/plugins/chat/app/models/chat/direct_message_user.rb
+++ b/plugins/chat/app/models/chat/direct_message_user.rb
@@ -16,7 +16,7 @@ end
# Table name: direct_message_users
#
# id :bigint not null, primary key
-# direct_message_channel_id :integer not null
+# direct_message_channel_id :bigint not null
# user_id :integer not null
# created_at :datetime not null
# updated_at :datetime not null
diff --git a/plugins/chat/app/models/chat/draft.rb b/plugins/chat/app/models/chat/draft.rb
index 6b1dc2d59e7..f8d5c79f02a 100644
--- a/plugins/chat/app/models/chat/draft.rb
+++ b/plugins/chat/app/models/chat/draft.rb
@@ -22,8 +22,9 @@ end
#
# id :bigint not null, primary key
# user_id :integer not null
-# chat_channel_id :integer not null
+# chat_channel_id :bigint not null
# data :text not null
# created_at :datetime not null
# updated_at :datetime not null
+# thread_id :bigint
#
diff --git a/plugins/chat/app/models/chat/group_mention.rb b/plugins/chat/app/models/chat/group_mention.rb
index 5a64237035a..45b9496bc6d 100644
--- a/plugins/chat/app/models/chat/group_mention.rb
+++ b/plugins/chat/app/models/chat/group_mention.rb
@@ -5,3 +5,20 @@ module Chat
belongs_to :group, foreign_key: :target_id
end
end
+
+# == Schema Information
+#
+# Table name: chat_mentions
+#
+# id :bigint not null, primary key
+# chat_message_id :bigint not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# type :string not null
+# target_id :integer
+#
+# Indexes
+#
+# index_chat_mentions_on_chat_message_id (chat_message_id)
+# index_chat_mentions_on_target_id (target_id)
+#
diff --git a/plugins/chat/app/models/chat/here_mention.rb b/plugins/chat/app/models/chat/here_mention.rb
index ca41d58ec6b..97db4a5b882 100644
--- a/plugins/chat/app/models/chat/here_mention.rb
+++ b/plugins/chat/app/models/chat/here_mention.rb
@@ -4,3 +4,20 @@ module Chat
class HereMention < Mention
end
end
+
+# == Schema Information
+#
+# Table name: chat_mentions
+#
+# id :bigint not null, primary key
+# chat_message_id :bigint not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# type :string not null
+# target_id :integer
+#
+# Indexes
+#
+# index_chat_mentions_on_chat_message_id (chat_message_id)
+# index_chat_mentions_on_target_id (target_id)
+#
diff --git a/plugins/chat/app/models/chat/incoming_webhook.rb b/plugins/chat/app/models/chat/incoming_webhook.rb
index 589eefbc55a..611ac2a8d3a 100644
--- a/plugins/chat/app/models/chat/incoming_webhook.rb
+++ b/plugins/chat/app/models/chat/incoming_webhook.rb
@@ -31,7 +31,7 @@ end
# id :bigint not null, primary key
# name :string not null
# key :string not null
-# chat_channel_id :integer not null
+# chat_channel_id :bigint not null
# username :string
# description :string
# emoji :string
diff --git a/plugins/chat/app/models/chat/mention.rb b/plugins/chat/app/models/chat/mention.rb
index e771852a461..ef42f9dbbe5 100644
--- a/plugins/chat/app/models/chat/mention.rb
+++ b/plugins/chat/app/models/chat/mention.rb
@@ -18,14 +18,14 @@ end
# Table name: chat_mentions
#
# id :bigint not null, primary key
-# chat_message_id :integer not null
-# target_id :integer
-# type :integer not null
+# chat_message_id :bigint not null
# created_at :datetime not null
# updated_at :datetime not null
+# type :string not null
+# target_id :integer
#
# Indexes
#
-# index_chat_mentions_on_chat_message_id (chat_message_id)
-# index_chat_mentions_on_target_id (target_id)
+# index_chat_mentions_on_chat_message_id (chat_message_id)
+# index_chat_mentions_on_target_id (target_id)
#
diff --git a/plugins/chat/app/models/chat/mention_notification.rb b/plugins/chat/app/models/chat/mention_notification.rb
index 577ccc075fb..a593f7539c6 100644
--- a/plugins/chat/app/models/chat/mention_notification.rb
+++ b/plugins/chat/app/models/chat/mention_notification.rb
@@ -17,7 +17,7 @@ end
#
# Table name: chat_mention_notifications
#
-# chat_mention_id :integer not null
+# chat_mention_id :bigint not null
# notification_id :bigint not null
#
# Indexes
diff --git a/plugins/chat/app/models/chat/message.rb b/plugins/chat/app/models/chat/message.rb
index c64d86307c4..5b09e5cf442 100644
--- a/plugins/chat/app/models/chat/message.rb
+++ b/plugins/chat/app/models/chat/message.rb
@@ -398,25 +398,29 @@ end
# Table name: chat_messages
#
# id :bigint not null, primary key
-# chat_channel_id :integer not null
+# chat_channel_id :bigint not null
# user_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# deleted_at :datetime
# deleted_by_id :integer
-# in_reply_to_id :integer
+# in_reply_to_id :bigint
# message :text
# cooked :text
# cooked_version :integer
# last_editor_id :integer not null
-# thread_id :integer
+# thread_id :bigint
+# streaming :boolean default(FALSE), not null
+# excerpt :string(1000)
+# created_by_sdk :boolean default(FALSE), not null
+# blocks :jsonb
#
# Indexes
#
# idx_chat_messages_by_created_at_not_deleted (created_at) WHERE (deleted_at IS NULL)
# idx_chat_messages_by_thread_id_not_deleted (thread_id) WHERE (deleted_at IS NULL)
# index_chat_messages_on_chat_channel_id_and_created_at (chat_channel_id,created_at)
-# index_chat_messages_on_chat_channel_id_and_id (chat_channel_id,id) WHERE (deleted_at IS NULL)
+# index_chat_messages_on_chat_channel_id_and_id (chat_channel_id,id) WHERE (deleted_at IS NOT NULL)
# index_chat_messages_on_last_editor_id (last_editor_id)
# index_chat_messages_on_thread_id (thread_id)
#
diff --git a/plugins/chat/app/models/chat/message_reaction.rb b/plugins/chat/app/models/chat/message_reaction.rb
index cb1e69cdd9d..05b537d9b29 100644
--- a/plugins/chat/app/models/chat/message_reaction.rb
+++ b/plugins/chat/app/models/chat/message_reaction.rb
@@ -16,7 +16,7 @@ end
# Table name: chat_message_reactions
#
# id :bigint not null, primary key
-# chat_message_id :integer
+# chat_message_id :bigint
# user_id :integer
# emoji :string
# created_at :datetime not null
diff --git a/plugins/chat/app/models/chat/message_revision.rb b/plugins/chat/app/models/chat/message_revision.rb
index 8a273443e1a..ff2ca7be124 100644
--- a/plugins/chat/app/models/chat/message_revision.rb
+++ b/plugins/chat/app/models/chat/message_revision.rb
@@ -17,7 +17,7 @@ end
# Table name: chat_message_revisions
#
# id :bigint not null, primary key
-# chat_message_id :integer
+# chat_message_id :bigint
# old_message :text not null
# new_message :text not null
# created_at :datetime not null
diff --git a/plugins/chat/app/models/chat/null_message.rb b/plugins/chat/app/models/chat/null_message.rb
index 2815d970c3d..c37cb84d314 100644
--- a/plugins/chat/app/models/chat/null_message.rb
+++ b/plugins/chat/app/models/chat/null_message.rb
@@ -19,3 +19,35 @@ module Chat
end
end
end
+
+# == Schema Information
+#
+# Table name: chat_messages
+#
+# id :bigint not null, primary key
+# chat_channel_id :bigint not null
+# user_id :integer
+# created_at :datetime not null
+# updated_at :datetime not null
+# deleted_at :datetime
+# deleted_by_id :integer
+# in_reply_to_id :bigint
+# message :text
+# cooked :text
+# cooked_version :integer
+# last_editor_id :integer not null
+# thread_id :bigint
+# streaming :boolean default(FALSE), not null
+# excerpt :string(1000)
+# created_by_sdk :boolean default(FALSE), not null
+# blocks :jsonb
+#
+# Indexes
+#
+# idx_chat_messages_by_created_at_not_deleted (created_at) WHERE (deleted_at IS NULL)
+# idx_chat_messages_by_thread_id_not_deleted (thread_id) WHERE (deleted_at IS NULL)
+# index_chat_messages_on_chat_channel_id_and_created_at (chat_channel_id,created_at)
+# index_chat_messages_on_chat_channel_id_and_id (chat_channel_id,id) WHERE (deleted_at IS NOT NULL)
+# index_chat_messages_on_last_editor_id (last_editor_id)
+# index_chat_messages_on_thread_id (thread_id)
+#
diff --git a/plugins/chat/app/models/chat/null_user.rb b/plugins/chat/app/models/chat/null_user.rb
index aca334f9c1c..d9d3f59f56d 100644
--- a/plugins/chat/app/models/chat/null_user.rb
+++ b/plugins/chat/app/models/chat/null_user.rb
@@ -15,3 +15,59 @@ module Chat
end
end
end
+
+# == Schema Information
+#
+# Table name: users
+#
+# id :integer not null, primary key
+# username :string(60) not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# name :string
+# last_posted_at :datetime
+# active :boolean default(FALSE), not null
+# username_lower :string(60) not null
+# last_seen_at :datetime
+# admin :boolean default(FALSE), not null
+# last_emailed_at :datetime
+# trust_level :integer not null
+# approved :boolean default(FALSE), not null
+# approved_by_id :integer
+# approved_at :datetime
+# previous_visit_at :datetime
+# suspended_at :datetime
+# suspended_till :datetime
+# date_of_birth :date
+# views :integer default(0), not null
+# flag_level :integer default(0), not null
+# ip_address :inet
+# moderator :boolean default(FALSE)
+# title :string
+# uploaded_avatar_id :integer
+# locale :string(10)
+# primary_group_id :integer
+# registration_ip_address :inet
+# staged :boolean default(FALSE), not null
+# first_seen_at :datetime
+# silenced_till :datetime
+# group_locked_trust_level :integer
+# manual_locked_trust_level :integer
+# secure_identifier :string
+# flair_group_id :integer
+# last_seen_reviewable_id :integer
+# required_fields_version :integer
+# seen_notification_id :bigint default(0), not null
+#
+# Indexes
+#
+# idx_users_admin (id) WHERE admin
+# idx_users_ip_address (ip_address)
+# idx_users_moderator (id) WHERE moderator
+# index_users_on_last_posted_at (last_posted_at)
+# index_users_on_last_seen_at (last_seen_at)
+# index_users_on_secure_identifier (secure_identifier) UNIQUE
+# index_users_on_uploaded_avatar_id (uploaded_avatar_id)
+# index_users_on_username (username) UNIQUE
+# index_users_on_username_lower (username_lower) UNIQUE
+#
diff --git a/plugins/chat/app/models/chat/reviewable_message.rb b/plugins/chat/app/models/chat/reviewable_message.rb
index be293fce1fc..a696e31fb98 100644
--- a/plugins/chat/app/models/chat/reviewable_message.rb
+++ b/plugins/chat/app/models/chat/reviewable_message.rb
@@ -167,3 +167,41 @@ module Chat
end
end
end
+
+# == Schema Information
+#
+# Table name: reviewables
+#
+# id :bigint not null, primary key
+# type :string not null
+# status :integer default("pending"), not null
+# created_by_id :integer not null
+# reviewable_by_moderator :boolean default(FALSE), not null
+# category_id :integer
+# topic_id :integer
+# score :float default(0.0), not null
+# potential_spam :boolean default(FALSE), not null
+# target_id :integer
+# target_type :string
+# target_created_by_id :integer
+# payload :json
+# version :integer default(0), not null
+# latest_score :datetime
+# created_at :datetime not null
+# updated_at :datetime not null
+# force_review :boolean default(FALSE), not null
+# reject_reason :text
+# potentially_illegal :boolean default(FALSE)
+# type_source :string default("unknown"), not null
+#
+# Indexes
+#
+# idx_reviewables_score_desc_created_at_desc (score,created_at)
+# index_reviewables_on_reviewable_by_group_id (reviewable_by_group_id)
+# index_reviewables_on_status_and_created_at (status,created_at)
+# index_reviewables_on_status_and_score (status,score)
+# index_reviewables_on_status_and_type (status,type)
+# index_reviewables_on_target_id_where_post_type_eq_post (target_id) WHERE ((target_type)::text = 'Post'::text)
+# index_reviewables_on_topic_id_and_status_and_created_by_id (topic_id,status,created_by_id)
+# index_reviewables_on_type_and_target_id (type,target_id) UNIQUE
+#
diff --git a/plugins/chat/app/models/chat/thread.rb b/plugins/chat/app/models/chat/thread.rb
index ad301d0601a..6b2253bd39b 100644
--- a/plugins/chat/app/models/chat/thread.rb
+++ b/plugins/chat/app/models/chat/thread.rb
@@ -149,15 +149,16 @@ end
# Table name: chat_threads
#
# id :bigint not null, primary key
-# channel_id :integer not null
-# original_message_id :integer not null
-# original_message_user_id :integer not null
+# channel_id :bigint not null
+# original_message_id :bigint not null
+# original_message_user_id :bigint not null
# status :integer default("open"), not null
# title :string
# created_at :datetime not null
# updated_at :datetime not null
# replies_count :integer default(0), not null
# last_message_id :bigint
+# force :boolean default(FALSE), not null
#
# Indexes
#
diff --git a/plugins/chat/app/models/chat/user_chat_channel_membership.rb b/plugins/chat/app/models/chat/user_chat_channel_membership.rb
index 4a28959c87c..6075e679b7f 100644
--- a/plugins/chat/app/models/chat/user_chat_channel_membership.rb
+++ b/plugins/chat/app/models/chat/user_chat_channel_membership.rb
@@ -26,13 +26,13 @@ end
#
# id :bigint not null, primary key
# user_id :integer not null
-# chat_channel_id :integer not null
-# last_read_message_id :integer
+# chat_channel_id :bigint not null
+# last_read_message_id :bigint
# following :boolean default(FALSE), not null
# muted :boolean default(FALSE), not null
# created_at :datetime not null
# updated_at :datetime not null
-# last_unread_mention_when_emailed_id :integer
+# last_unread_mention_when_emailed_id :bigint
# join_mode :integer default("manual"), not null
# last_viewed_at :datetime not null
# notification_level :integer default("mention"), not null
diff --git a/plugins/chat/app/models/chat/user_chat_thread_membership.rb b/plugins/chat/app/models/chat/user_chat_thread_membership.rb
index 66fefac791b..bf535b62803 100644
--- a/plugins/chat/app/models/chat/user_chat_thread_membership.rb
+++ b/plugins/chat/app/models/chat/user_chat_thread_membership.rb
@@ -20,16 +20,18 @@ end
#
# Table name: user_chat_thread_memberships
#
-# id :bigint not null, primary key
-# user_id :bigint not null
-# thread_id :bigint not null
-# last_read_message_id :bigint
-# notification_level :integer default("tracking"), not null
-# thread_title_prompt_seen :boolean default(false), not null
-# created_at :datetime not null
-# updated_at :datetime not null
+# id :bigint not null, primary key
+# user_id :bigint not null
+# thread_id :bigint not null
+# last_read_message_id :bigint
+# notification_level :integer default("tracking"), not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# thread_title_prompt_seen :boolean default(FALSE), not null
+# last_unread_message_when_emailed_id :bigint
#
# Indexes
#
-# user_chat_thread_unique_memberships (user_id,thread_id) UNIQUE
+# idx_user_chat_thread_memberships_on_thread_id_user_id (thread_id,user_id)
+# user_chat_thread_unique_memberships (user_id,thread_id) UNIQUE
#
diff --git a/plugins/chat/app/models/chat/user_mention.rb b/plugins/chat/app/models/chat/user_mention.rb
index b1aa75a2b57..c2da6cdaed3 100644
--- a/plugins/chat/app/models/chat/user_mention.rb
+++ b/plugins/chat/app/models/chat/user_mention.rb
@@ -5,3 +5,20 @@ module Chat
belongs_to :user, foreign_key: :target_id
end
end
+
+# == Schema Information
+#
+# Table name: chat_mentions
+#
+# id :bigint not null, primary key
+# chat_message_id :bigint not null
+# created_at :datetime not null
+# updated_at :datetime not null
+# type :string not null
+# target_id :integer
+#
+# Indexes
+#
+# index_chat_mentions_on_chat_message_id (chat_message_id)
+# index_chat_mentions_on_target_id (target_id)
+#
diff --git a/plugins/chat/app/models/chat/webhook_event.rb b/plugins/chat/app/models/chat/webhook_event.rb
index fe2aecb2bcf..b1a23298070 100644
--- a/plugins/chat/app/models/chat/webhook_event.rb
+++ b/plugins/chat/app/models/chat/webhook_event.rb
@@ -17,8 +17,8 @@ end
# Table name: chat_webhook_events
#
# id :bigint not null, primary key
-# chat_message_id :integer not null
-# incoming_chat_webhook_id :integer not null
+# chat_message_id :bigint not null
+# incoming_chat_webhook_id :bigint not null
# created_at :datetime not null
# updated_at :datetime not null
#