summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20190603173419_add_tag_index_to_objects.exs
blob: 9ba95917c0baa2d0e7d48b6c3669c07b2cb64c5f (plain)
1
2
3
4
5
6
7
8
9
10
11
defmodule Pleroma.Repo.Migrations.AddTagIndexToObjects do
  use Ecto.Migration

  def change do
    drop_if_exists(
      index(:activities, ["(data #> '{\"object\",\"tag\"}')"], using: :gin, name: :activities_tags)
    )

    create_if_not_exists(index(:objects, ["(data->'tag')"], using: :gin, name: :objects_tags))
  end
end