From 089b1d164c67d58926c9462bd793f5a931208f45 Mon Sep 17 00:00:00 2001
From: Sam <sam.saffron@gmail.com>
Date: Mon, 30 May 2016 10:45:32 +1000
Subject: [PATCH] annotate models

(reminder run RAILS_ENV=test bin/annotate once in a while)
---
 app/models/email_log.rb            |  2 ++
 app/models/incoming_email.rb       |  3 +++
 app/models/onceoff_log.rb          | 14 ++++++++++++++
 app/models/tag.rb                  | 15 +++++++++++++++
 app/models/tag_user.rb             | 17 +++++++++++++++++
 app/models/topic_custom_field.rb   |  2 +-
 app/models/topic_tag.rb            | 15 +++++++++++++++
 app/models/translation_override.rb |  1 +
 app/models/user.rb                 |  1 +
 app/models/user_option.rb          |  1 +
 app/models/user_stat.rb            | 28 +++++++++++++++-------------
 11 files changed, 85 insertions(+), 14 deletions(-)

diff --git a/app/models/email_log.rb b/app/models/email_log.rb
index 99d12b52d1d..ceb32d5252b 100644
--- a/app/models/email_log.rb
+++ b/app/models/email_log.rb
@@ -73,6 +73,8 @@ end
 #  topic_id       :integer
 #  skipped        :boolean          default(FALSE)
 #  skipped_reason :string
+#  bounce_key     :string
+#  bounced        :boolean          default(FALSE), not null
 #
 # Indexes
 #
diff --git a/app/models/incoming_email.rb b/app/models/incoming_email.rb
index 1266d665e2f..97427699d92 100644
--- a/app/models/incoming_email.rb
+++ b/app/models/incoming_email.rb
@@ -24,10 +24,13 @@ end
 #  created_at        :datetime         not null
 #  updated_at        :datetime         not null
 #  rejection_message :text
+#  is_auto_generated :boolean          default(FALSE)
+#  is_bounce         :boolean          default(FALSE), not null
 #
 # Indexes
 #
 #  index_incoming_emails_on_created_at  (created_at)
 #  index_incoming_emails_on_error       (error)
 #  index_incoming_emails_on_message_id  (message_id)
+#  index_incoming_emails_on_post_id     (post_id)
 #
diff --git a/app/models/onceoff_log.rb b/app/models/onceoff_log.rb
index 88e43f19b4b..12ce7377c51 100644
--- a/app/models/onceoff_log.rb
+++ b/app/models/onceoff_log.rb
@@ -1,2 +1,16 @@
 class OnceoffLog < ActiveRecord::Base
 end
+
+# == Schema Information
+#
+# Table name: onceoff_logs
+#
+#  id         :integer          not null, primary key
+#  job_name   :string
+#  created_at :datetime         not null
+#  updated_at :datetime         not null
+#
+# Indexes
+#
+#  index_onceoff_logs_on_job_name  (job_name)
+#
diff --git a/app/models/tag.rb b/app/models/tag.rb
index bb628d38f9e..3d03aa83d3f 100644
--- a/app/models/tag.rb
+++ b/app/models/tag.rb
@@ -16,3 +16,18 @@ class Tag < ActiveRecord::Base
         .map {|name, count| name}
   end
 end
+
+# == Schema Information
+#
+# Table name: tags
+#
+#  id          :integer          not null, primary key
+#  name        :string           not null
+#  topic_count :integer          default(0), not null
+#  created_at  :datetime
+#  updated_at  :datetime
+#
+# Indexes
+#
+#  index_tags_on_name  (name) UNIQUE
+#
diff --git a/app/models/tag_user.rb b/app/models/tag_user.rb
index 1abd68ea0ec..96244cf2117 100644
--- a/app/models/tag_user.rb
+++ b/app/models/tag_user.rb
@@ -93,3 +93,20 @@ class TagUser < ActiveRecord::Base
 
   private_class_method :apply_default_to_topic, :remove_default_from_topic
 end
+
+# == Schema Information
+#
+# Table name: tag_users
+#
+#  id                 :integer          not null, primary key
+#  tag_id             :integer          not null
+#  user_id            :integer          not null
+#  notification_level :integer          not null
+#  created_at         :datetime
+#  updated_at         :datetime
+#
+# Indexes
+#
+#  idx_tag_users_ix1  (user_id,tag_id,notification_level) UNIQUE
+#  idx_tag_users_ix2  (tag_id,user_id,notification_level) UNIQUE
+#
diff --git a/app/models/topic_custom_field.rb b/app/models/topic_custom_field.rb
index 22685679d7d..5dd6e53c731 100644
--- a/app/models/topic_custom_field.rb
+++ b/app/models/topic_custom_field.rb
@@ -16,5 +16,5 @@ end
 # Indexes
 #
 #  index_topic_custom_fields_on_topic_id_and_name  (topic_id,name)
-#  index_topic_custom_fields_on_value              (value)
+#  topic_custom_fields_value_key_idx               (value,name)
 #
diff --git a/app/models/topic_tag.rb b/app/models/topic_tag.rb
index 9882ddf2450..f8dc3cfee01 100644
--- a/app/models/topic_tag.rb
+++ b/app/models/topic_tag.rb
@@ -2,3 +2,18 @@ class TopicTag < ActiveRecord::Base
   belongs_to :topic
   belongs_to :tag, counter_cache: "topic_count"
 end
+
+# == Schema Information
+#
+# Table name: topic_tags
+#
+#  id         :integer          not null, primary key
+#  topic_id   :integer          not null
+#  tag_id     :integer          not null
+#  created_at :datetime
+#  updated_at :datetime
+#
+# Indexes
+#
+#  index_topic_tags_on_topic_id_and_tag_id  (topic_id,tag_id) UNIQUE
+#
diff --git a/app/models/translation_override.rb b/app/models/translation_override.rb
index 408c46f098a..d39c48221b1 100644
--- a/app/models/translation_override.rb
+++ b/app/models/translation_override.rb
@@ -41,6 +41,7 @@ end
 #  value           :string           not null
 #  created_at      :datetime         not null
 #  updated_at      :datetime         not null
+#  compiled_js     :text
 #
 # Indexes
 #
diff --git a/app/models/user.rb b/app/models/user.rb
index 4b20b97187d..a4917e0eed9 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1037,6 +1037,7 @@ end
 #  registration_ip_address :inet
 #  trust_level_locked      :boolean          default(FALSE), not null
 #  staged                  :boolean          default(FALSE), not null
+#  first_seen_at           :datetime
 #
 # Indexes
 #
diff --git a/app/models/user_option.rb b/app/models/user_option.rb
index ad4ac23a49a..6f0a8ecbdc6 100644
--- a/app/models/user_option.rb
+++ b/app/models/user_option.rb
@@ -151,6 +151,7 @@ end
 #  email_in_reply_to             :boolean          default(TRUE), not null
 #  like_notification_frequency   :integer          default(1), not null
 #  include_tl0_in_digests        :boolean          default(FALSE)
+#  mailing_list_mode_frequency   :integer          default(0), not null
 #
 # Indexes
 #
diff --git a/app/models/user_stat.rb b/app/models/user_stat.rb
index 746ad3557b8..7898a2e57be 100644
--- a/app/models/user_stat.rb
+++ b/app/models/user_stat.rb
@@ -103,17 +103,19 @@ end
 #
 # Table name: user_stats
 #
-#  user_id               :integer          not null, primary key
-#  topics_entered        :integer          default(0), not null
-#  time_read             :integer          default(0), not null
-#  days_visited          :integer          default(0), not null
-#  posts_read_count      :integer          default(0), not null
-#  likes_given           :integer          default(0), not null
-#  likes_received        :integer          default(0), not null
-#  topic_reply_count     :integer          default(0), not null
-#  new_since             :datetime         not null
-#  read_faq              :datetime
-#  first_post_created_at :datetime
-#  post_count            :integer          default(0), not null
-#  topic_count           :integer          default(0), not null
+#  user_id                  :integer          not null, primary key
+#  topics_entered           :integer          default(0), not null
+#  time_read                :integer          default(0), not null
+#  days_visited             :integer          default(0), not null
+#  posts_read_count         :integer          default(0), not null
+#  likes_given              :integer          default(0), not null
+#  likes_received           :integer          default(0), not null
+#  topic_reply_count        :integer          default(0), not null
+#  new_since                :datetime         not null
+#  read_faq                 :datetime
+#  first_post_created_at    :datetime
+#  post_count               :integer          default(0), not null
+#  topic_count              :integer          default(0), not null
+#  bounce_score             :integer          default(0), not null
+#  reset_bounce_score_after :datetime
 #