From b60ec3b173c660b8e66caa4688db34a51ec2dfde Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 23 Aug 2019 03:17:20 +0300 Subject: [PATCH] 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. --- priv/repo/migrations/20190823000549_add_likes_index_to_objects.exs | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 priv/repo/migrations/20190823000549_add_likes_index_to_objects.exs 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