Migrations: Create index after filling up the db.
This commit is contained in:
parent
0ff1985304
commit
0d7109254b
@ -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
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user