From da8fbef5d63c8743d4e9f87d0c9c9a08318a2ddb Mon Sep 17 00:00:00 2001 From: evazion Date: Mon, 11 Nov 2019 20:34:44 -0600 Subject: [PATCH] /ip_addresses: add missing created_at, uploader_ip_addr indexes. Add some missing indexes used by the /ip_addresses page. --- ...191111024520_index_tables_on_created_at.rb | 8 ++++++ db/structure.sql | 26 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 db/migrate/20191111024520_index_tables_on_created_at.rb diff --git a/db/migrate/20191111024520_index_tables_on_created_at.rb b/db/migrate/20191111024520_index_tables_on_created_at.rb new file mode 100644 index 000000000..06340020d --- /dev/null +++ b/db/migrate/20191111024520_index_tables_on_created_at.rb @@ -0,0 +1,8 @@ +class IndexTablesOnCreatedAt < ActiveRecord::Migration[6.0] + def change + add_index :artist_commentary_versions, :created_at + add_index :users, :created_at + add_index :comments, :created_at + add_index :posts, :uploader_ip_addr + end +end diff --git a/db/structure.sql b/db/structure.sql index 54b0a1b13..f0ed11df2 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -4763,6 +4763,13 @@ CREATE UNIQUE INDEX index_api_keys_on_user_id ON public.api_keys USING btree (us CREATE UNIQUE INDEX index_artist_commentaries_on_post_id ON public.artist_commentaries USING btree (post_id); +-- +-- Name: index_artist_commentary_versions_on_created_at; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_artist_commentary_versions_on_created_at ON public.artist_commentary_versions USING btree (created_at); + + -- -- Name: index_artist_commentary_versions_on_post_id; Type: INDEX; Schema: public; Owner: - -- @@ -4931,6 +4938,12 @@ CREATE INDEX index_comment_votes_on_created_at ON public.comment_votes USING btr CREATE INDEX index_comment_votes_on_user_id ON public.comment_votes USING btree (user_id); +-- +-- Name: index_comments_on_created_at; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_comments_on_created_at ON public.comments USING btree (created_at); + -- -- Name: index_comments_on_body_index; Type: INDEX; Schema: public; Owner: - -- @@ -6932,6 +6945,12 @@ CREATE INDEX index_posts_on_tags_index ON public.posts USING gin (tag_index); CREATE INDEX index_posts_on_uploader_id ON public.posts USING btree (uploader_id); +-- +-- Name: index_posts_on_uploader_ip_addr; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_posts_on_uploader_ip_addr ON public.posts USING btree (uploader_ip_addr); + -- -- Name: index_saved_searches_on_labels; Type: INDEX; Schema: public; Owner: - @@ -7129,6 +7148,13 @@ CREATE INDEX index_user_name_change_requests_on_original_name ON public.user_nam CREATE INDEX index_user_name_change_requests_on_user_id ON public.user_name_change_requests USING btree (user_id); +-- +-- Name: index_users_on_created_at; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_users_on_created_at ON public.users USING btree (created_at); + + -- -- Name: index_users_on_email; Type: INDEX; Schema: public; Owner: - --