Index changeset comments by author and date

This commit is contained in:
Tom Hughes 2020-10-06 22:42:44 +01:00
parent 0b421c9314
commit 1946c84f71
2 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,7 @@
class AddAuthorIndexToChangesetComments < ActiveRecord::Migration[6.0]
disable_ddl_transaction!
def change
add_index :changeset_comments, [:author_id, :created_at], :algorithm => :concurrently
end
end

View file

@ -2255,6 +2255,13 @@ CREATE UNIQUE INDEX index_active_storage_attachments_uniqueness ON public.active
CREATE UNIQUE INDEX index_active_storage_blobs_on_key ON public.active_storage_blobs USING btree (key);
--
-- Name: index_changeset_comments_on_author_id_and_created_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_changeset_comments_on_author_id_and_created_at ON public.changeset_comments USING btree (author_id, created_at);
--
-- Name: index_changeset_comments_on_created_at; Type: INDEX; Schema: public; Owner: -
--
@ -3138,6 +3145,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20190702193519'),
('20190716173946'),
('20191120140058'),
('20201006213836'),
('21'),
('22'),
('23'),