From e66eefe179ad04b6b066bb828135e9d1ac25ae01 Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Tue, 1 Sep 2020 10:22:32 +0530 Subject: [PATCH] Annotate models. --- app/models/color_scheme.rb | 17 ++++++++--------- app/models/post_search_data.rb | 1 + app/models/topic_custom_field.rb | 5 +++-- app/models/user_custom_field.rb | 1 + 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/models/color_scheme.rb b/app/models/color_scheme.rb index ab82c117a92..abe4e6d1644 100644 --- a/app/models/color_scheme.rb +++ b/app/models/color_scheme.rb @@ -317,13 +317,12 @@ end # # Table name: color_schemes # -# id :integer not null, primary key -# name :string not null -# version :integer default(1), not null -# created_at :datetime not null -# updated_at :datetime not null -# via_wizard :boolean default(FALSE), not null -# base_scheme_id :string -# theme_id :integer -# user_selectable :boolean default(FALSE), not null +# id :integer not null, primary key +# name :string not null +# version :integer default(1), not null +# created_at :datetime not null +# updated_at :datetime not null +# via_wizard :boolean default(FALSE), not null +# base_scheme_id :string +# theme_id :integer # diff --git a/app/models/post_search_data.rb b/app/models/post_search_data.rb index 3a12c0bcf39..b6e07cd7d9e 100644 --- a/app/models/post_search_data.rb +++ b/app/models/post_search_data.rb @@ -17,6 +17,7 @@ end # # Indexes # +# idx_regular_post_search_data (search_data) WHERE (NOT private_message) USING gin # idx_search_post (search_data) USING gin # index_post_search_data_on_post_id_and_version_and_locale (post_id,version,locale) # diff --git a/app/models/topic_custom_field.rb b/app/models/topic_custom_field.rb index ba5767084e5..85e839c8293 100644 --- a/app/models/topic_custom_field.rb +++ b/app/models/topic_custom_field.rb @@ -17,6 +17,7 @@ end # # Indexes # -# 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)) +# idx_topic_custom_fields_topic_post_event_starts_at (name,topic_id) UNIQUE WHERE ((name)::text = 'TopicEventStartsAt'::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)) # diff --git a/app/models/user_custom_field.rb b/app/models/user_custom_field.rb index 0fb77e5f634..a01c5ca7e99 100644 --- a/app/models/user_custom_field.rb +++ b/app/models/user_custom_field.rb @@ -17,5 +17,6 @@ end # # Indexes # +# idx_user_custom_fields_on_holiday (name,user_id) UNIQUE WHERE ((name)::text = 'on_holiday'::text) # index_user_custom_fields_on_user_id_and_name (user_id,name) #