summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20200708193702_drop_user_trigram_index.exs
diff options
context:
space:
mode:
authorMark Felder <feld@FreeBSD.org>2020-07-10 11:34:53 -0500
committerMark Felder <feld@FreeBSD.org>2020-07-10 11:34:53 -0500
commit3c0c1fd2efa981f18091782434c1f0ac77462b8e (patch)
tree7776233f9248d4e1caee6ad859af3a524347d926 /priv/repo/migrations/20200708193702_drop_user_trigram_index.exs
parentd7a37fddd1fc5169ae8c714d0baf8e5372a5f1d5 (diff)
parentce9514000db1e08a69b8874f21e66261b9261d86 (diff)
downloadpleroma-3c0c1fd2efa981f18091782434c1f0ac77462b8e.tar.gz
pleroma-3c0c1fd2efa981f18091782434c1f0ac77462b8e.zip
Merge branch 'develop' into issue/1790-updated-oban
Diffstat (limited to 'priv/repo/migrations/20200708193702_drop_user_trigram_index.exs')
-rw-r--r--priv/repo/migrations/20200708193702_drop_user_trigram_index.exs18
1 files changed, 18 insertions, 0 deletions
diff --git a/priv/repo/migrations/20200708193702_drop_user_trigram_index.exs b/priv/repo/migrations/20200708193702_drop_user_trigram_index.exs
new file mode 100644
index 000000000..94efe323a
--- /dev/null
+++ b/priv/repo/migrations/20200708193702_drop_user_trigram_index.exs
@@ -0,0 +1,18 @@
+defmodule Pleroma.Repo.Migrations.DropUserTrigramIndex do
+ @moduledoc "Drops unused trigram index on `users` (FTS index is being used instead)"
+
+ use Ecto.Migration
+
+ def up do
+ drop_if_exists(index(:users, [], name: :users_trigram_index))
+ end
+
+ def down do
+ create_if_not_exists(
+ index(:users, ["(trim(nickname || ' ' || coalesce(name, ''))) gist_trgm_ops"],
+ name: :users_trigram_index,
+ using: :gist
+ )
+ )
+ end
+end