Add GIN index on object data->'name'
authorrinpatch <rinpatch@sdf.org>
Wed, 22 May 2019 08:56:53 +0000 (11:56 +0300)
committerrinpatch <rinpatch@sdf.org>
Wed, 22 May 2019 08:56:53 +0000 (11:56 +0300)
priv/repo/migrations/20190522084924_add_object_index_on_name.exs [new file with mode: 0644]

diff --git a/priv/repo/migrations/20190522084924_add_object_index_on_name.exs b/priv/repo/migrations/20190522084924_add_object_index_on_name.exs
new file mode 100644 (file)
index 0000000..886e849
--- /dev/null
@@ -0,0 +1,7 @@
+defmodule Pleroma.Repo.Migrations.AddObjectIndexOnName do
+  use Ecto.Migration
+
+  def change do
+    create(index(:objects, ["(data->'name')"], name: :objects_name_index, using: :gin))
+  end
+end