Migrations: Create index after filling up the db.

This commit is contained in:
lain 2019-10-09 16:55:58 +02:00
parent 0ff1985304
commit 0d7109254b
2 changed files with 1 additions and 2 deletions

View File

@ -5,7 +5,5 @@ defmodule Pleroma.Repo.Migrations.AddApIdColumnToObjects do
alter table(:objects) do alter table(:objects) do
add :ap_id, :string add :ap_id, :string
end end
create unique_index(:objects, [:ap_id])
end end
end end

View File

@ -3,5 +3,6 @@ defmodule Pleroma.Repo.Migrations.FillObjectApIdField do
def change do def change do
execute("update objects set ap_id = data->>'id'") execute("update objects set ap_id = data->>'id'")
create unique_index(:objects, [:ap_id])
end end
end end