From: Roger Braun Date: Mon, 1 May 2017 13:42:05 +0000 (+0200) Subject: Actually make index unique. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=b9d1fc05b22e29b15208cd6fdcb5d40d34d2a83e;p=akkoma Actually make index unique. --- diff --git a/priv/repo/migrations/20170501133231_add_id_contraints_to_activities_and_objects_part_two.exs b/priv/repo/migrations/20170501133231_add_id_contraints_to_activities_and_objects_part_two.exs new file mode 100644 index 000000000..12eea1369 --- /dev/null +++ b/priv/repo/migrations/20170501133231_add_id_contraints_to_activities_and_objects_part_two.exs @@ -0,0 +1,10 @@ +defmodule Pleroma.Repo.Migrations.AddIdContraintsToActivitiesAndObjectsPartTwo do + use Ecto.Migration + + def change do + drop index(:objects, ["(data->>\"id\")"], name: :objects_unique_apid_index) + drop index(:activities, ["(data->>\"id\")"], name: :activities_unique_apid_index) + create unique_index(:objects, ["(data->>'id')"], name: :objects_unique_apid_index) + create unique_index(:activities, ["(data->>'id')"], name: :activities_unique_apid_index) + end +end