summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20170701142005_add_actor_index_to_activity.exs
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-07-01 16:43:10 +0200
committerRoger Braun <roger@rogerbraun.net>2017-07-01 16:43:10 +0200
commit5e17e0414412a951ffc549db9231759292d55bc1 (patch)
tree567a1d4394d997a0aab537d79f6f865f3c080095 /priv/repo/migrations/20170701142005_add_actor_index_to_activity.exs
parent9cda5b897a17af9191de2261daf530b3f294d60d (diff)
downloadpleroma-5e17e0414412a951ffc549db9231759292d55bc1.tar.gz
pleroma-5e17e0414412a951ffc549db9231759292d55bc1.zip
Make user timelines faster for users with few statuses.
Diffstat (limited to 'priv/repo/migrations/20170701142005_add_actor_index_to_activity.exs')
-rw-r--r--priv/repo/migrations/20170701142005_add_actor_index_to_activity.exs7
1 files changed, 7 insertions, 0 deletions
diff --git a/priv/repo/migrations/20170701142005_add_actor_index_to_activity.exs b/priv/repo/migrations/20170701142005_add_actor_index_to_activity.exs
new file mode 100644
index 000000000..82c64396f
--- /dev/null
+++ b/priv/repo/migrations/20170701142005_add_actor_index_to_activity.exs
@@ -0,0 +1,7 @@
+defmodule Pleroma.Repo.Migrations.AddActorIndexToActivity do
+ use Ecto.Migration
+
+ def change do
+ create index(:activities, ["(data->>'actor')", "inserted_at desc"], name: :activities_actor_index)
+ end
+end