From 51c15787804884391403a19df7667cfaadd9a9fa Mon Sep 17 00:00:00 2001 From: lain Date: Mon, 7 Oct 2019 18:06:48 +0200 Subject: [PATCH] Object: Add the ap_id column. --- lib/pleroma/object.ex | 1 + .../migrations/20191007123056_add_ap_id_column_to_objects.exs | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 priv/repo/migrations/20191007123056_add_ap_id_column_to_objects.exs diff --git a/lib/pleroma/object.ex b/lib/pleroma/object.ex index cdfbacb0e..9ff6e588a 100644 --- a/lib/pleroma/object.ex +++ b/lib/pleroma/object.ex @@ -19,6 +19,7 @@ defmodule Pleroma.Object do schema "objects" do field(:data, :map) + field(:ap_id, :string) timestamps() end 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 new file mode 100644 index 000000000..ebc94833c --- /dev/null +++ b/priv/repo/migrations/20191007123056_add_ap_id_column_to_objects.exs @@ -0,0 +1,11 @@ +defmodule Pleroma.Repo.Migrations.AddApIdColumnToObjects do + use Ecto.Migration + + def change do + alter table(:objects) do + add :ap_id, :string + end + + create unique_index(:objects, [:ap_id], concurrently: true) + end +end