diff --git a/app/models/category.rb b/app/models/category.rb index 72fe1b6e49f..54f59af7226 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -560,5 +560,5 @@ end # # index_categories_on_email_in (email_in) UNIQUE # index_categories_on_topic_count (topic_count) -# unique_index_categories_on_name (name) UNIQUE +# unique_index_categories_on_name ((COALESCE(parent_category_id, '-1'::integer)), name) UNIQUE # diff --git a/app/models/post_custom_field.rb b/app/models/post_custom_field.rb index 713d0affbc8..999500de527 100644 --- a/app/models/post_custom_field.rb +++ b/app/models/post_custom_field.rb @@ -15,6 +15,6 @@ end # # Indexes # -# index_post_custom_fields_on_name_and_value (name) +# index_post_custom_fields_on_name_and_value (name, "left"(value, 200)) # index_post_custom_fields_on_post_id_and_name (post_id,name) # diff --git a/app/models/topic.rb b/app/models/topic.rb index 59822cd2562..f4093cb8f5c 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -1336,6 +1336,7 @@ end # index_topics_on_bumped_at (bumped_at) # index_topics_on_created_at_and_visible (created_at,visible) # index_topics_on_id_and_deleted_at (id,deleted_at) +# index_topics_on_lower_title (lower((title)::text)) # index_topics_on_pinned_at (pinned_at) # index_topics_on_pinned_globally (pinned_globally) # diff --git a/app/models/upload.rb b/app/models/upload.rb index 329e59714af..148deea2279 100644 --- a/app/models/upload.rb +++ b/app/models/upload.rb @@ -170,6 +170,7 @@ end # # Indexes # +# index_uploads_on_extension (lower((extension)::text)) # index_uploads_on_id_and_url (id,url) # index_uploads_on_sha1 (sha1) UNIQUE # index_uploads_on_url (url) diff --git a/app/models/user.rb b/app/models/user.rb index 3c3d4abc9d6..2429418648a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1124,6 +1124,7 @@ end # name :string # seen_notification_id :integer default(0), not null # last_posted_at :datetime +# email :string(513) # password_hash :string(64) # salt :string(32) # active :boolean default(FALSE), not null @@ -1157,6 +1158,7 @@ end # # idx_users_admin (id) # idx_users_moderator (id) +# index_users_on_email (lower((email)::text)) UNIQUE # index_users_on_last_posted_at (last_posted_at) # index_users_on_last_seen_at (last_seen_at) # index_users_on_uploaded_avatar_id (uploaded_avatar_id) diff --git a/app/models/user_email.rb b/app/models/user_email.rb index 485c3f0bc08..c7b35eb3cea 100644 --- a/app/models/user_email.rb +++ b/app/models/user_email.rb @@ -42,6 +42,7 @@ end # # Indexes # +# index_user_emails_on_email (lower((email)::text)) UNIQUE # index_user_emails_on_user_id (user_id) # index_user_emails_on_user_id_and_primary (user_id,primary) UNIQUE #