X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=priv%2Frepo%2Fmigrations%2F20190501125843_add_fts_index_to_objects.exs;h=41630bace6b4a1c8b070435767c81a38e5e57040;hb=73609211a425922a5068d3912a36b82abe24e12c;hp=9b274695eb89281db6d04852efc4e8cbc2eaeb74;hpb=f4e2595592ccca6cedd64669baef7bdd2a6547d0;p=akkoma diff --git a/priv/repo/migrations/20190501125843_add_fts_index_to_objects.exs b/priv/repo/migrations/20190501125843_add_fts_index_to_objects.exs index 9b274695e..41630bace 100644 --- a/priv/repo/migrations/20190501125843_add_fts_index_to_objects.exs +++ b/priv/repo/migrations/20190501125843_add_fts_index_to_objects.exs @@ -2,7 +2,18 @@ defmodule Pleroma.Repo.Migrations.AddFTSIndexToObjects do use Ecto.Migration def change do - drop_if_exists index(:activities, ["(to_tsvector('english', data->'object'->>'content'))"], using: :gin, name: :activities_fts) - create index(:objects, ["(to_tsvector('english', data->>'content'))"], using: :gin, name: :objects_fts) + drop_if_exists( + index(:activities, ["(to_tsvector('english', data->'object'->>'content'))"], + using: :gin, + name: :activities_fts + ) + ) + + create_if_not_exists( + index(:objects, ["(to_tsvector('english', data->>'content'))"], + using: :gin, + name: :objects_fts + ) + ) end end