diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-07-10 08:49:14 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-07-10 08:49:14 +0000 |
commit | 5ea638757210c34b40fb568e537082b78f4118a6 (patch) | |
tree | 6635ffb2117ec4765969484cb437d7f1f7ea1e79 /priv/repo/migrations | |
parent | 8743df5193018238eff730447519300b271cd592 (diff) | |
parent | 123352ffa1c80aab658fca0c2276d1c06de43a02 (diff) | |
download | pleroma-5ea638757210c34b40fb568e537082b78f4118a6.tar.gz |
Merge branch 'user-search-nickname-rank-boost' into 'develop'
Improved search results for localized nickname match
See merge request pleroma/pleroma!2733
Diffstat (limited to 'priv/repo/migrations')
-rw-r--r-- | priv/repo/migrations/20200708193702_drop_user_trigram_index.exs | 18 |
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 |