From a7a5f90e20870c93e461b431492c1b320b59d5e8 Mon Sep 17 00:00:00 2001
From: Guo Xiang Tan <tgx_world@hotmail.com>
Date: Fri, 5 Apr 2019 17:13:12 +0800
Subject: [PATCH] Annotate models.

---
 app/models/category.rb    |  1 +
 app/models/topic.rb       |  1 +
 app/models/user_action.rb | 11 ++++++-----
 app/models/user_stat.rb   |  2 +-
 4 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/app/models/category.rb b/app/models/category.rb
index 98399c282ac..1ae55c4358f 100644
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -733,6 +733,7 @@ end
 #  minimum_required_tags             :integer          default(0), not null
 #  navigate_to_first_post_after_read :boolean          default(FALSE), not null
 #  search_priority                   :integer          default(0)
+#  allow_global_tags                 :boolean          default(FALSE), not null
 #
 # Indexes
 #
diff --git a/app/models/topic.rb b/app/models/topic.rb
index 5a41765962b..317b9c15b3c 100644
--- a/app/models/topic.rb
+++ b/app/models/topic.rb
@@ -1552,4 +1552,5 @@ end
 #  index_topics_on_lower_title             (lower((title)::text))
 #  index_topics_on_pinned_at               (pinned_at) WHERE (pinned_at IS NOT NULL)
 #  index_topics_on_pinned_globally         (pinned_globally) WHERE pinned_globally
+#  index_topics_on_updated_at_public       (updated_at,visible,highest_staff_post_number,highest_post_number,category_id,created_at,id) WHERE (((archetype)::text <> 'private_message'::text) AND (deleted_at IS NULL))
 #
diff --git a/app/models/user_action.rb b/app/models/user_action.rb
index 25afc8619b8..7e043b71078 100644
--- a/app/models/user_action.rb
+++ b/app/models/user_action.rb
@@ -428,9 +428,10 @@ end
 #
 # Indexes
 #
-#  idx_unique_rows                                (action_type,user_id,target_topic_id,target_post_id,acting_user_id) UNIQUE
-#  idx_user_actions_speed_up_user_all             (user_id,created_at,action_type)
-#  index_user_actions_on_acting_user_id           (acting_user_id)
-#  index_user_actions_on_target_post_id           (target_post_id)
-#  index_user_actions_on_user_id_and_action_type  (user_id,action_type)
+#  idx_unique_rows                                   (action_type,user_id,target_topic_id,target_post_id,acting_user_id) UNIQUE
+#  idx_user_actions_speed_up_user_all                (user_id,created_at,action_type)
+#  index_user_actions_on_acting_user_id              (acting_user_id)
+#  index_user_actions_on_action_type_and_created_at  (action_type,created_at)
+#  index_user_actions_on_target_post_id              (target_post_id)
+#  index_user_actions_on_user_id_and_action_type     (user_id,action_type)
 #
diff --git a/app/models/user_stat.rb b/app/models/user_stat.rb
index e56ed2dba25..e512a942e92 100644
--- a/app/models/user_stat.rb
+++ b/app/models/user_stat.rb
@@ -204,5 +204,5 @@ end
 #  flags_agreed             :integer          default(0), not null
 #  flags_disagreed          :integer          default(0), not null
 #  flags_ignored            :integer          default(0), not null
-#  first_unread_at          :datetime
+#  first_unread_at          :datetime         not null
 #