Add correct index.
authorRoger Braun <roger@rogerbraun.net>
Tue, 20 Jun 2017 14:25:28 +0000 (16:25 +0200)
committerRoger Braun <roger@rogerbraun.net>
Tue, 20 Jun 2017 14:25:28 +0000 (16:25 +0200)
priv/repo/migrations/20170620142420_add_object_activity_index_part_two.exs [new file with mode: 0644]

diff --git a/priv/repo/migrations/20170620142420_add_object_activity_index_part_two.exs b/priv/repo/migrations/20170620142420_add_object_activity_index_part_two.exs
new file mode 100644 (file)
index 0000000..705a05f
--- /dev/null
@@ -0,0 +1,8 @@
+defmodule Pleroma.Repo.Migrations.AddObjectActivityIndexPartTwo do
+  use Ecto.Migration
+
+  def change do
+    drop index(:objects, ["(data->'object'->>'id')", "(data->>'type')"], name: :activities_create_objects_index)
+    create index(:activities, ["(data->'object'->>'id')", "(data->>'type')"], name: :activities_create_objects_index)
+  end
+end