User search: Make uri matches case insensitive.

This commit is contained in:
lain 2020-09-25 08:56:58 +02:00
parent a8c17ea25a
commit 1e0f3f8514
2 changed files with 20 additions and 1 deletions

View 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

View file

@ -41,7 +41,7 @@ test "returns a user with matching uri as the first result" do
insert(:user, %{ insert(:user, %{
nickname: "no_relation", nickname: "no_relation",
ap_id: "https://lain.com/users/lain", ap_id: "https://lain.com/users/lain",
uri: "https://lain.com/@lain" uri: "https://lain.com/@Lain"
}) })
_user = insert(:user, %{nickname: "com_user"}) _user = insert(:user, %{nickname: "com_user"})