Add fts search index.
authorRoger Braun <roger@rogerbraun.net>
Sat, 16 Sep 2017 09:06:55 +0000 (11:06 +0200)
committerRoger Braun <roger@rogerbraun.net>
Sat, 16 Sep 2017 09:06:55 +0000 (11:06 +0200)
priv/repo/migrations/20170916090107_add_fts_index_to_activities.exs [new file with mode: 0644]

diff --git a/priv/repo/migrations/20170916090107_add_fts_index_to_activities.exs b/priv/repo/migrations/20170916090107_add_fts_index_to_activities.exs
new file mode 100644 (file)
index 0000000..c17da83
--- /dev/null
@@ -0,0 +1,8 @@
+defmodule Pleroma.Repo.Migrations.AddFTSIndexToActivities do
+  use Ecto.Migration
+  @disable_ddl_transaction true
+
+  def change do
+    create index(:activities, ["(to_tsvector('english', data->'object'->>'content'))"], concurrently: true, using: :gin, name: :activities_fts)
+  end
+end