diff --git a/db/migrate/20170319000519_add_created_at_index_to_versions.rb b/db/migrate/20170319000519_add_created_at_index_to_versions.rb new file mode 100644 index 000000000..38b6df765 --- /dev/null +++ b/db/migrate/20170319000519_add_created_at_index_to_versions.rb @@ -0,0 +1,10 @@ +class AddCreatedAtIndexToVersions < ActiveRecord::Migration + def change + ActiveRecord::Base.without_timeout do + add_index :note_versions, :created_at + add_index :artist_versions, :created_at + add_index :wiki_page_versions, :created_at + add_index :post_appeals, :created_at + end + end +end diff --git a/db/structure.sql b/db/structure.sql index db56a9db0..08ac0f916 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -4977,6 +4977,13 @@ CREATE INDEX index_artist_urls_on_url_pattern ON artist_urls USING btree (url te CREATE INDEX index_artist_versions_on_artist_id ON artist_versions USING btree (artist_id); +-- +-- Name: index_artist_versions_on_created_at; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_artist_versions_on_created_at ON artist_versions USING btree (created_at); + + -- -- Name: index_artist_versions_on_name; Type: INDEX; Schema: public; Owner: - -- @@ -6706,6 +6713,13 @@ CREATE UNIQUE INDEX index_key_values_on_key ON key_values USING btree (key); CREATE INDEX index_news_updates_on_created_at ON news_updates USING btree (created_at); +-- +-- Name: index_note_versions_on_created_at; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_note_versions_on_created_at ON note_versions USING btree (created_at); + + -- -- Name: index_note_versions_on_note_id; Type: INDEX; Schema: public; Owner: - -- @@ -6790,6 +6804,13 @@ CREATE INDEX index_pools_on_name ON pools USING btree (name); CREATE INDEX index_pools_on_name_trgm ON pools USING gin (name gin_trgm_ops); +-- +-- Name: index_post_appeals_on_created_at; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_post_appeals_on_created_at ON post_appeals USING btree (created_at); + + -- -- Name: index_post_appeals_on_creator_id; Type: INDEX; Schema: public; Owner: - -- @@ -7147,6 +7168,13 @@ CREATE UNIQUE INDEX index_users_on_name ON users USING btree (lower((name)::text CREATE INDEX index_users_on_name_trgm ON users USING gin (lower((name)::text) gin_trgm_ops); +-- +-- Name: index_wiki_page_versions_on_created_at; Type: INDEX; Schema: public; Owner: - +-- + +CREATE INDEX index_wiki_page_versions_on_created_at ON wiki_page_versions USING btree (created_at); + + -- -- Name: index_wiki_page_versions_on_updater_ip_addr; Type: INDEX; Schema: public; Owner: - -- @@ -7532,3 +7560,4 @@ INSERT INTO schema_migrations (version) VALUES ('20170314235626'); INSERT INTO schema_migrations (version) VALUES ('20170316224630'); +INSERT INTO schema_migrations (version) VALUES ('20170319000519');