From: Tom Hughes Date: Wed, 17 Jan 2024 18:57:12 +0000 (+0000) Subject: Drop lowercase index on display names X-Git-Tag: live~879^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/9db635a992ec6464c40ac69eadeac78dff60ccf9?ds=sidebyside Drop lowercase index on display names --- diff --git a/app/models/user.rb b/app/models/user.rb index b04f8e2b9..8ed6d4465 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -37,7 +37,6 @@ # users_auth_idx (auth_provider,auth_uid) UNIQUE # users_display_name_canonical_idx (lower(NORMALIZE(display_name, NFKC))) # users_display_name_idx (display_name) UNIQUE -# users_display_name_lower_idx (lower((display_name)::text)) # users_email_idx (email) UNIQUE # users_email_lower_idx (lower((email)::text)) # users_home_idx (home_tile) diff --git a/db/migrate/20240117185445_drop_lowercase_user_index.rb b/db/migrate/20240117185445_drop_lowercase_user_index.rb new file mode 100644 index 000000000..82bd5ece7 --- /dev/null +++ b/db/migrate/20240117185445_drop_lowercase_user_index.rb @@ -0,0 +1,5 @@ +class DropLowercaseUserIndex < ActiveRecord::Migration[7.1] + def change + remove_index :users, "LOWER(display_name)", :name => "users_display_name_lower_idx" + end +end diff --git a/db/structure.sql b/db/structure.sql index c9fdebbc8..4998bc694 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -2936,13 +2936,6 @@ CREATE INDEX users_display_name_canonical_idx ON public.users USING btree (lower CREATE UNIQUE INDEX users_display_name_idx ON public.users USING btree (display_name); --- --- Name: users_display_name_lower_idx; Type: INDEX; Schema: public; Owner: - --- - -CREATE INDEX users_display_name_lower_idx ON public.users USING btree (lower((display_name)::text)); - - -- -- Name: users_email_idx; Type: INDEX; Schema: public; Owner: - -- @@ -3588,6 +3581,7 @@ INSERT INTO "schema_migrations" (version) VALUES ('23'), ('22'), ('21'), +('20240117185445'), ('20231213182102'), ('20231206141457'), ('20231117170422'),