Merge remote-tracking branch 'upstream/pull/5747'

This commit is contained in:
Tom Hughes 2025-03-08 10:56:41 +00:00
commit 70d61a17e5
5 changed files with 42 additions and 7 deletions

View file

@ -16,10 +16,11 @@
#
# Indexes
#
# index_notes_on_description (to_tsvector('english'::regconfig, description)) USING gin
# notes_created_at_idx (created_at)
# notes_tile_status_idx (tile,status)
# notes_updated_at_idx (updated_at)
# index_notes_on_description (to_tsvector('english'::regconfig, description)) USING gin
# index_notes_on_user_id_and_created_at (user_id,created_at) WHERE (user_id IS NOT NULL)
# notes_created_at_idx (created_at)
# notes_tile_status_idx (tile,status)
# notes_updated_at_idx (updated_at)
#
# Foreign Keys
#

View file

@ -16,9 +16,10 @@
#
# Indexes
#
# gpx_files_timestamp_idx (timestamp)
# gpx_files_user_id_idx (user_id)
# gpx_files_visible_visibility_idx (visible,visibility)
# gpx_files_timestamp_idx (timestamp)
# gpx_files_user_id_idx (user_id)
# gpx_files_visible_visibility_idx (visible,visibility)
# index_gpx_files_on_user_id_and_id (user_id,id)
#
# Foreign Keys
#

View file

@ -0,0 +1,7 @@
class AddGpxFilesUserIdIdIndex < ActiveRecord::Migration[7.2]
disable_ddl_transaction!
def change
add_index :gpx_files, [:user_id, :id], :algorithm => :concurrently
end
end

View file

@ -0,0 +1,9 @@
class AddNotesUserIdCreatedAtIndex < ActiveRecord::Migration[7.2]
disable_ddl_transaction!
def change
add_index :notes, [:user_id, :created_at],
:algorithm => :concurrently,
:where => "user_id IS NOT NULL"
end
end

View file

@ -9,6 +9,7 @@ SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
--
-- Name: btree_gist; Type: EXTENSION; Schema: -; Owner: -
--
@ -2463,6 +2464,13 @@ CREATE INDEX index_diary_entry_subscriptions_on_diary_entry_id ON public.diary_e
CREATE INDEX index_friends_on_user_id_and_created_at ON public.friends USING btree (user_id, created_at);
--
-- Name: index_gpx_files_on_user_id_and_id; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_gpx_files_on_user_id_and_id ON public.gpx_files USING btree (user_id, id);
--
-- Name: index_issue_comments_on_issue_id; Type: INDEX; Schema: public; Owner: -
--
@ -2547,6 +2555,13 @@ CREATE INDEX index_note_subscriptions_on_note_id ON public.note_subscriptions US
CREATE INDEX index_notes_on_description ON public.notes USING gin (to_tsvector('english'::regconfig, description));
--
-- Name: index_notes_on_user_id_and_created_at; Type: INDEX; Schema: public; Owner: -
--
CREATE INDEX index_notes_on_user_id_and_created_at ON public.notes USING btree (user_id, created_at) WHERE (user_id IS NOT NULL);
--
-- Name: index_oauth_access_grants_on_application_id; Type: INDEX; Schema: public; Owner: -
--
@ -3429,6 +3444,8 @@ INSERT INTO "schema_migrations" (version) VALUES
('23'),
('22'),
('21'),
('20250304172798'),
('20250304172758'),
('20250212160355'),
('20250206202905'),
('20250121191749'),