summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20200708193702_drop_user_trigram_index.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-07-27 16:35:47 +0000
committerlain <lain@soykaf.club>2020-07-27 16:35:47 +0000
commite1a1c8e7de5e10fa64d168dc5d35a80b96767395 (patch)
treec0057448e323c730bea2c76cecf9efb85ef14181 /priv/repo/migrations/20200708193702_drop_user_trigram_index.exs
parent4a6389316dac53c1ca2ec36d160690476d881185 (diff)
parent2a3abfd326f0cbb588dfe66a23e9783be3038a5e (diff)
downloadpleroma-e1a1c8e7de5e10fa64d168dc5d35a80b96767395.tar.gz
pleroma-e1a1c8e7de5e10fa64d168dc5d35a80b96767395.zip
Merge branch 'develop' into 'cleanup/masto_fe-default_settings'
# Conflicts: # lib/pleroma/web/views/masto_fe_view.ex
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