From: lain Date: Fri, 25 Sep 2020 06:56:58 +0000 (+0200) Subject: User search: Make uri matches case insensitive. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=1e0f3f8514a42b088ed68ece5f9e339ad829e242;p=akkoma User search: Make uri matches case insensitive. --- diff --git a/priv/repo/migrations/20200925065249_make_user_ids_ci.exs b/priv/repo/migrations/20200925065249_make_user_ids_ci.exs new file mode 100644 index 000000000..b7305f137 --- /dev/null +++ b/priv/repo/migrations/20200925065249_make_user_ids_ci.exs @@ -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 diff --git a/test/user_search_test.exs b/test/user_search_test.exs index cc14e9741..b99a77b57 100644 --- a/test/user_search_test.exs +++ b/test/user_search_test.exs @@ -41,7 +41,7 @@ defmodule Pleroma.UserSearchTest 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"})