Skip to content

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

DEV: annotate models

Sam Saffron3dc4ab905c6a
diff --git a/app/models/category.rb b/app/models/category.rb
index a4cc14ecefd..18a6c185c06 100644
--- a/app/models/category.rb
+++ b/app/models/category.rb
@@ -742,11 +742,13 @@ end
# navigate_to_first_post_after_read :boolean default(FALSE), not null
# search_priority :integer default(0)
# allow_global_tags :boolean default(FALSE), not null
+# reviewable_by_group_id :integer
#
# Indexes
#
-# index_categories_on_email_in (email_in) UNIQUE
-# index_categories_on_search_priority (search_priority)
-# index_categories_on_topic_count (topic_count)
-# unique_index_categories_on_name (COALESCE(parent_category_id, '-1'::integer), name) UNIQUE
+# index_categories_on_email_in (email_in) UNIQUE
+# index_categories_on_reviewable_by_group_id (reviewable_by_group_id)
+# index_categories_on_search_priority (search_priority)
+# index_categories_on_topic_count (topic_count)
+# unique_index_categories_on_name (COALESCE(parent_category_id, '-1'::integer), name) UNIQUE
#
diff --git a/app/models/category_tag_stat.rb b/app/models/category_tag_stat.rb
index 2dc686c31f2..f16e37e41cb 100644
--- a/app/models/category_tag_stat.rb
+++ b/app/models/category_tag_stat.rb
@@ -66,9 +66,9 @@ end
#
# Table name: category_tag_stats
#
-# id :bigint(8) not null, primary key
-# category_id :bigint(8) not null
-# tag_id :bigint(8) not null
+# id :bigint not null, primary key
+# category_id :bigint not null
+# tag_id :bigint not null
# topic_count :integer default(0), not null
#
# Indexes
diff --git a/app/models/group_request.rb b/app/models/group_request.rb
index f6b731d2968..57aafb41936 100644
--- a/app/models/group_request.rb
+++ b/app/models/group_request.rb
@@ -7,7 +7,7 @@ end
#
# Table name: group_requests
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# group_id :integer
# user_id :integer
# reason :text
diff --git a/app/models/ignored_user.rb b/app/models/ignored_user.rb
index 588a7a9b786..a0810b03a28 100644
--- a/app/models/ignored_user.rb
+++ b/app/models/ignored_user.rb
@@ -7,7 +7,7 @@ end
#
# Table name: ignored_users
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# user_id :integer not null
# ignored_user_id :integer not null
# created_at :datetime not null
diff --git a/app/models/javascript_cache.rb b/app/models/javascript_cache.rb
index cb850af6de1..6efc44d6196 100644
--- a/app/models/javascript_cache.rb
+++ b/app/models/javascript_cache.rb
@@ -25,8 +25,8 @@ end
#
# Table name: javascript_caches
#
-# id :bigint(8) not null, primary key
-# theme_field_id :bigint(8) not null
+# id :bigint not null, primary key
+# theme_field_id :bigint not null
# digest :string
# content :text not null
# created_at :datetime not null
diff --git a/app/models/post_reply_key.rb b/app/models/post_reply_key.rb
index 3f1479f6a01..b82eceaac6d 100644
--- a/app/models/post_reply_key.rb
+++ b/app/models/post_reply_key.rb
@@ -21,7 +21,7 @@ end
#
# Table name: post_reply_keys
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# user_id :integer not null
# post_id :integer not null
# reply_key :uuid not null
diff --git a/app/models/push_subscription.rb b/app/models/push_subscription.rb
index caa68558d11..0367e5638bf 100644
--- a/app/models/push_subscription.rb
+++ b/app/models/push_subscription.rb
@@ -6,7 +6,7 @@ end
#
# Table name: push_subscriptions
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# user_id :integer not null
# data :string not null
# created_at :datetime not null
diff --git a/app/models/reviewable.rb b/app/models/reviewable.rb
index aaa5f18e61a..3f326371f18 100644
--- a/app/models/reviewable.rb
+++ b/app/models/reviewable.rb
@@ -476,7 +476,7 @@ end
#
# Table name: reviewables
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# type :string not null
# status :integer default(0), not null
# created_by_id :integer not null
@@ -498,6 +498,7 @@ end
#
# Indexes
#
+# 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)
diff --git a/app/models/reviewable_flagged_post.rb b/app/models/reviewable_flagged_post.rb
index cf5829b611b..9cc622d231d 100644
--- a/app/models/reviewable_flagged_post.rb
+++ b/app/models/reviewable_flagged_post.rb
@@ -288,7 +288,7 @@ end
#
# Table name: reviewables
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# type :string not null
# status :integer default(0), not null
# created_by_id :integer not null
@@ -310,6 +310,7 @@ end
#
# Indexes
#
+# 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)
diff --git a/app/models/reviewable_history.rb b/app/models/reviewable_history.rb
index 1df79daadd7..9159d86de08 100644
--- a/app/models/reviewable_history.rb
+++ b/app/models/reviewable_history.rb
@@ -16,7 +16,7 @@ end
#
# Table name: reviewable_histories
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# reviewable_id :integer not null
# reviewable_history_type :integer not null
# status :integer not null
diff --git a/app/models/reviewable_queued_post.rb b/app/models/reviewable_queued_post.rb
index 2933dff09d2..63804864d50 100644
--- a/app/models/reviewable_queued_post.rb
+++ b/app/models/reviewable_queued_post.rb
@@ -139,7 +139,7 @@ end
#
# Table name: reviewables
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# type :string not null
# status :integer default(0), not null
# created_by_id :integer not null
@@ -161,6 +161,7 @@ end
#
# Indexes
#
+# 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)
diff --git a/app/models/reviewable_score.rb b/app/models/reviewable_score.rb
index 144b5ac9d33..1d3af75f4ad 100644
--- a/app/models/reviewable_score.rb
+++ b/app/models/reviewable_score.rb
@@ -74,7 +74,7 @@ end
#
# Table name: reviewable_scores
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# reviewable_id :integer not null
# user_id :integer not null
# reviewable_score_type :integer not null
diff --git a/app/models/reviewable_user.rb b/app/models/reviewable_user.rb
index 3f1f2ee470f..23659e31b1f 100644
--- a/app/models/reviewable_user.rb
+++ b/app/models/reviewable_user.rb
@@ -95,7 +95,7 @@ end
#
# Table name: reviewables
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# type :string not null
# status :integer default(0), not null
# created_by_id :integer not null
@@ -117,6 +117,7 @@ end
#
# Indexes
#
+# 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)
diff --git a/app/models/shared_draft.rb b/app/models/shared_draft.rb
index c45b30ea8eb..9fdac77dcbb 100644
--- a/app/models/shared_draft.rb
+++ b/app/models/shared_draft.rb
@@ -11,7 +11,7 @@ end
# category_id :integer not null
# created_at :datetime not null
# updated_at :datetime not null
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
#
# Indexes
#
diff --git a/app/models/skipped_email_log.rb b/app/models/skipped_email_log.rb
index 0fc28fa1419..04682a6ea12 100644
--- a/app/models/skipped_email_log.rb
+++ b/app/models/skipped_email_log.rb
@@ -70,7 +70,7 @@ end
#
# Table name: skipped_email_logs
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# email_type :string not null
# to_address :string not null
# user_id :integer
diff --git a/app/models/tag_group_permission.rb b/app/models/tag_group_permission.rb
index 49f4a97333f..90ba02e1be0 100644
--- a/app/models/tag_group_permission.rb
+++ b/app/models/tag_group_permission.rb
@@ -12,9 +12,9 @@ end
#
# Table name: tag_group_permissions
#
-# id :bigint(8) not null, primary key
-# tag_group_id :bigint(8) not null
-# group_id :bigint(8) not null
+# id :bigint not null, primary key
+# tag_group_id :bigint not null
+# group_id :bigint not null
# permission_type :integer default(1), not null
# created_at :datetime not null
# updated_at :datetime not null
diff --git a/app/models/theme_setting.rb b/app/models/theme_setting.rb
index b961dc1a65d..cfb68445774 100644
--- a/app/models/theme_setting.rb
+++ b/app/models/theme_setting.rb
@@ -58,7 +58,7 @@ end
#
# Table name: theme_settings
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# name :string(255) not null
# data_type :integer not null
# value :text
diff --git a/app/models/theme_translation_override.rb b/app/models/theme_translation_override.rb
index 70aaa9110ce..516483aae47 100644
--- a/app/models/theme_translation_override.rb
+++ b/app/models/theme_translation_override.rb
@@ -12,7 +12,7 @@ end
#
# Table name: theme_translation_overrides
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# theme_id :integer not null
# locale :string not null
# translation_key :string not null
diff --git a/app/models/user_associated_account.rb b/app/models/user_associated_account.rb
index d21078153cb..b20c9ad2804 100644
--- a/app/models/user_associated_account.rb
+++ b/app/models/user_associated_account.rb
@@ -12,7 +12,7 @@ end
#
# Table name: user_associated_accounts
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# provider_name :string not null
# provider_uid :string not null
# user_id :integer
diff --git a/app/models/user_profile.rb b/app/models/user_profile.rb
index a810c308663..3bf7ec71b26 100644
--- a/app/models/user_profile.rb
+++ b/app/models/user_profile.rb
@@ -154,20 +154,16 @@ end
# website :string
# bio_raw :text
# bio_cooked :text
-# profile_background :string(255)
# dismissed_banner_key :integer
# bio_cooked_version :integer
# badge_granted_title :boolean default(FALSE)
-# card_background :string(255)
# views :integer default(0), not null
# profile_background_upload_id :integer
# card_background_upload_id :integer
#
# Indexes
#
-# index_user_profiles_on_bio_cooked_version (bio_cooked_version)
-# index_user_profiles_on_card_background (card_background)
-# index_user_profiles_on_card_background_upload_id (card_background_upload_id)
-# index_user_profiles_on_profile_background (profile_background)
-# index_user_profiles_on_profile_background_upload_id (profile_background_upload_id)
+# index_user_profiles_on_bio_cooked_version (bio_cooked_version)
+# index_user_profiles_on_card_background (card_background)
+# index_user_profiles_on_profile_background (profile_background)
#
diff --git a/app/models/user_second_factor.rb b/app/models/user_second_factor.rb
index 4dea44f7ae7..7ad41b95ea7 100644
--- a/app/models/user_second_factor.rb
+++ b/app/models/user_second_factor.rb
@@ -26,7 +26,7 @@ end
#
# Table name: user_second_factors
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# user_id :integer not null
# method :integer not null
# data :string not null
diff --git a/app/models/user_upload.rb b/app/models/user_upload.rb
index fa0c7d4ed1d..ee839ac8681 100644
--- a/app/models/user_upload.rb
+++ b/app/models/user_upload.rb
@@ -7,7 +7,7 @@ end
#
# Table name: user_uploads
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# upload_id :integer not null
# user_id :integer not null
# created_at :datetime not null
diff --git a/app/models/web_crawler_request.rb b/app/models/web_crawler_request.rb
index 905cb835ae3..2c0048e0369 100644
--- a/app/models/web_crawler_request.rb
+++ b/app/models/web_crawler_request.rb
@@ -79,7 +79,7 @@ end
#
# Table name: web_crawler_requests
#
-# id :bigint(8) not null, primary key
+# id :bigint not null, primary key
# date :date not null
# user_agent :string not null
# count :integer default(0), not null