summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2019-08-23 03:17:20 +0300
committerrinpatch <rinpatch@sdf.org>2019-09-29 14:30:51 +0300
commitb60ec3b173c660b8e66caa4688db34a51ec2dfde (patch)
tree8b44e6906fbaaf9927f3cee40faa737c8a59f0be
parent7030721b3141b3390aeac2d0e7f6d355b210117f (diff)
Add an index on object likes
In !1538 favorites timeline was switched to use the joined object, but no idex on likes in the joined object was added.
-rw-r--r--priv/repo/migrations/20190823000549_add_likes_index_to_objects.exs7
1 files changed, 7 insertions, 0 deletions
diff --git a/priv/repo/migrations/20190823000549_add_likes_index_to_objects.exs b/priv/repo/migrations/20190823000549_add_likes_index_to_objects.exs
new file mode 100644
index 000000000..13f3d6e83
--- /dev/null
+++ b/priv/repo/migrations/20190823000549_add_likes_index_to_objects.exs
@@ -0,0 +1,7 @@
+defmodule Pleroma.Repo.Migrations.AddLikesIndexToObjects do
+ use Ecto.Migration
+
+ def change do
+ create_if_not_exists index(:objects, ["(data->'likes')"], using: :gin, name: :objects_likes)
+ end
+end