openstreetmap-website/db/migrate/20231213182102_add_canonical_user_index.rb
Tom Hughes c12f8959dd Require user names to be unique after unicode normalisation
As with the previous checks on case sensitivity this only affects
new users, and changes to names of existing users.
2023-12-13 22:27:36 +00:00

7 lines
245 B
Ruby

class AddCanonicalUserIndex < ActiveRecord::Migration[7.1]
disable_ddl_transaction!
def change
add_index :users, "LOWER(NORMALIZE(display_name, NFKC))", :name => "users_display_name_canonical_idx", :algorithm => :concurrently
end
end