]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/4648'
authorTom Hughes <tom@compton.nu>
Sun, 7 Apr 2024 11:14:08 +0000 (12:14 +0100)
committerTom Hughes <tom@compton.nu>
Sun, 7 Apr 2024 11:14:08 +0000 (12:14 +0100)
app/models/user_block.rb
db/migrate/20240405083825_add_creator_index_to_user_blocks.rb [new file with mode: 0644]
db/structure.sql

index 7af1f9bdc2d009a562bb910a6d560c6e7ae1846a..4fe50d921219320f04426eb82394d6e2a7d0cffc 100644 (file)
@@ -15,7 +15,8 @@
 #
 # Indexes
 #
-#  index_user_blocks_on_user_id  (user_id)
+#  index_user_blocks_on_creator_id_and_id  (creator_id,id)
+#  index_user_blocks_on_user_id            (user_id)
 #
 # Foreign Keys
 #
diff --git a/db/migrate/20240405083825_add_creator_index_to_user_blocks.rb b/db/migrate/20240405083825_add_creator_index_to_user_blocks.rb
new file mode 100644 (file)
index 0000000..542a102
--- /dev/null
@@ -0,0 +1,7 @@
+class AddCreatorIndexToUserBlocks < ActiveRecord::Migration[7.1]
+  disable_ddl_transaction!
+
+  def change
+    add_index :user_blocks, [:creator_id, :id], :algorithm => :concurrently
+  end
+end
index 294fda4c8f503e9472bbf1db16f2d3b1c462c8e0..829595e7c7431afc17946a7a57e8d14fb93bc71e 100644 (file)
@@ -2728,6 +2728,13 @@ CREATE INDEX index_reports_on_issue_id ON public.reports USING btree (issue_id);
 CREATE INDEX index_reports_on_user_id ON public.reports USING btree (user_id);
 
 
+--
+-- Name: index_user_blocks_on_creator_id_and_id; Type: INDEX; Schema: public; Owner: -
+--
+
+CREATE INDEX index_user_blocks_on_creator_id_and_id ON public.user_blocks USING btree (creator_id, id);
+
+
 --
 -- Name: index_user_blocks_on_user_id; Type: INDEX; Schema: public; Owner: -
 --
@@ -3512,6 +3519,7 @@ INSERT INTO "schema_migrations" (version) VALUES
 ('23'),
 ('22'),
 ('21'),
+('20240405083825'),
 ('20240307181018'),
 ('20240307180830'),
 ('20240228205723'),