migrations: add index creation migration and recipients_to/cc removal migration
authorWilliam Pitcock <nenolod@dereferenced.org>
Wed, 29 Aug 2018 18:38:51 +0000 (18:38 +0000)
committerWilliam Pitcock <nenolod@dereferenced.org>
Wed, 29 Aug 2018 18:41:02 +0000 (18:41 +0000)
priv/repo/migrations/20180829182612_activities_add_to_cc_indices.exs [new file with mode: 0644]
priv/repo/migrations/20180829183529_remove_recipients_to_and_cc_fields_from_activities.exs [new file with mode: 0644]

diff --git a/priv/repo/migrations/20180829182612_activities_add_to_cc_indices.exs b/priv/repo/migrations/20180829182612_activities_add_to_cc_indices.exs
new file mode 100644 (file)
index 0000000..f6c622e
--- /dev/null
@@ -0,0 +1,8 @@
+defmodule Pleroma.Repo.Migrations.ActivitiesAddToCcIndices do
+  use Ecto.Migration
+
+  def change do
+    create index(:activities, ["(data->'to')"], name: :activities_to_index, using: :gin)
+    create index(:activities, ["(data->'cc')"], name: :activities_cc_index, using: :gin)
+  end
+end
diff --git a/priv/repo/migrations/20180829183529_remove_recipients_to_and_cc_fields_from_activities.exs b/priv/repo/migrations/20180829183529_remove_recipients_to_and_cc_fields_from_activities.exs
new file mode 100644 (file)
index 0000000..ed4f5af
--- /dev/null
@@ -0,0 +1,10 @@
+defmodule Pleroma.Repo.Migrations.RemoveRecipientsToAndCcFieldsFromActivities do
+  use Ecto.Migration
+
+  def change do
+    alter table(:activities) do
+      remove :recipients_to
+      remove :recipients_cc
+    end
+  end
+end