URI paths are not actually case-insesitive, which caused migration issues
on a number of databases.
Closes #2188
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
+ def change do
+ # Migration retired, see
+ # https://git.pleroma.social/pleroma/pleroma/-/issues/2188
+ :noop
end
end
--- /dev/null
+defmodule Pleroma.Repo.Migrations.RevertCitextChange do
+ use Ecto.Migration
+
+ def change do
+ alter table(:users) do
+ modify(:uri, :text)
+ end
+
+ create_if_not_exists(unique_index(:users, :uri))
+ end
+end
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"})