From: Roger Braun Date: Mon, 1 May 2017 12:54:58 +0000 (+0200) Subject: Ensure we have no duplicate ap ids. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=2f093db051efb2252342e3490eea3a8ae67e06d3;p=akkoma Ensure we have no duplicate ap ids. --- diff --git a/priv/repo/migrations/20170501124823_add_id_contraints_to_activities_and_objects.exs b/priv/repo/migrations/20170501124823_add_id_contraints_to_activities_and_objects.exs new file mode 100644 index 000000000..21534adc7 --- /dev/null +++ b/priv/repo/migrations/20170501124823_add_id_contraints_to_activities_and_objects.exs @@ -0,0 +1,8 @@ +defmodule Pleroma.Repo.Migrations.AddIdContraintsToActivitiesAndObjects do + use Ecto.Migration + + def change do + create index(:objects, ["(data->>\"id\")"], name: :objects_unique_apid_index) + create index(:activities, ["(data->>\"id\")"], name: :activities_unique_apid_index) + end +end