]> git.openstreetmap.org Git - rails.git/commitdiff
Index changeset comments by author and date
authorTom Hughes <tom@compton.nu>
Tue, 6 Oct 2020 21:42:44 +0000 (22:42 +0100)
committerTom Hughes <tom@compton.nu>
Tue, 6 Oct 2020 21:42:44 +0000 (22:42 +0100)
db/migrate/20201006213836_add_author_index_to_changeset_comments.rb [new file with mode: 0644]
db/structure.sql

diff --git a/db/migrate/20201006213836_add_author_index_to_changeset_comments.rb b/db/migrate/20201006213836_add_author_index_to_changeset_comments.rb
new file mode 100644 (file)
index 0000000..fd2af33
--- /dev/null
@@ -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
index 75edb001e21f4c7381797868e6d63453054dda06..58d7b6653ebbe9647bbb06d2f3fdb8d35c77263e 100644 (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'),