diff --git a/priv/repo/migrations/20191007123056_add_ap_id_column_to_objects.exs b/priv/repo/migrations/20191007123056_add_ap_id_column_to_objects.exs index fb38fa29c..c0548b6d6 100644 --- a/priv/repo/migrations/20191007123056_add_ap_id_column_to_objects.exs +++ b/priv/repo/migrations/20191007123056_add_ap_id_column_to_objects.exs @@ -5,7 +5,5 @@ defmodule Pleroma.Repo.Migrations.AddApIdColumnToObjects do alter table(:objects) do add :ap_id, :string end - - create unique_index(:objects, [:ap_id]) end end diff --git a/priv/repo/migrations/20191007160755_fill_object_ap_id_field.exs b/priv/repo/migrations/20191007160755_fill_object_ap_id_field.exs index 55834b3e1..81ecc27f7 100644 --- a/priv/repo/migrations/20191007160755_fill_object_ap_id_field.exs +++ b/priv/repo/migrations/20191007160755_fill_object_ap_id_field.exs @@ -3,5 +3,6 @@ defmodule Pleroma.Repo.Migrations.FillObjectApIdField do def change do execute("update objects set ap_id = data->>'id'") + create unique_index(:objects, [:ap_id]) end end