User search: Make uri matches case insensitive.
This commit is contained in:
parent
a8c17ea25a
commit
1e0f3f8514
2 changed files with 20 additions and 1 deletions
19
priv/repo/migrations/20200925065249_make_user_ids_ci.exs
Normal file
19
priv/repo/migrations/20200925065249_make_user_ids_ci.exs
Normal file
|
@ -0,0 +1,19 @@
|
|||
defmodule Pleroma.Repo.Migrations.MakeUserIdsCI do
|
||||
use Ecto.Migration
|
||||
|
||||
def up do
|
||||
alter table(:users) do
|
||||
modify(:uri, :citext)
|
||||
end
|
||||
|
||||
create(unique_index(:users, :uri))
|
||||
end
|
||||
|
||||
def don do
|
||||
drop(unique_index(:users, :uri))
|
||||
|
||||
alter table(:users) do
|
||||
modify(:uri, :text)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -41,7 +41,7 @@ test "returns a user with matching uri as the first result" do
|
|||
insert(:user, %{
|
||||
nickname: "no_relation",
|
||||
ap_id: "https://lain.com/users/lain",
|
||||
uri: "https://lain.com/@lain"
|
||||
uri: "https://lain.com/@Lain"
|
||||
})
|
||||
|
||||
_user = insert(:user, %{nickname: "com_user"})
|
||||
|
|
Loading…
Reference in a new issue