mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 00:26:30 +00:00
Revert citext user URI migration
URI paths are not actually case-insesitive, which caused migration issues on a number of databases. Closes #2188
This commit is contained in:
parent
35157f5dc8
commit
7bc561127d
3 changed files with 16 additions and 15 deletions
|
@ -1,19 +1,9 @@
|
||||||
defmodule Pleroma.Repo.Migrations.MakeUserIdsCI do
|
defmodule Pleroma.Repo.Migrations.MakeUserIdsCI do
|
||||||
use Ecto.Migration
|
use Ecto.Migration
|
||||||
|
|
||||||
def up do
|
def change do
|
||||||
alter table(:users) do
|
# Migration retired, see
|
||||||
modify(:uri, :citext)
|
# https://git.pleroma.social/pleroma/pleroma/-/issues/2188
|
||||||
end
|
:noop
|
||||||
|
|
||||||
create(unique_index(:users, :uri))
|
|
||||||
end
|
|
||||||
|
|
||||||
def don do
|
|
||||||
drop(unique_index(:users, :uri))
|
|
||||||
|
|
||||||
alter table(:users) do
|
|
||||||
modify(:uri, :text)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
11
priv/repo/migrations/20200928145912_revert_citext_change.exs
Normal file
11
priv/repo/migrations/20200928145912_revert_citext_change.exs
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
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
|
|
@ -41,7 +41,7 @@ defmodule Pleroma.UserSearchTest 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"})
|
||||||
|
|
Loading…
Reference in a new issue