diff options
| author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-07-10 08:55:15 +0000 |
|---|---|---|
| committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-07-10 08:55:15 +0000 |
| commit | 4ac6e6283f6e090588ad56066b1e552b895f3a24 (patch) | |
| tree | c6536c1ab63ea26913b649cc3f64cea438b62f38 /priv/repo/migrations/20200708193702_drop_user_trigram_index.exs | |
| parent | c2be0da79fcc95399647b292e0b9a4119d3dcdf1 (diff) | |
| parent | 5ea638757210c34b40fb568e537082b78f4118a6 (diff) | |
| download | pleroma-4ac6e6283f6e090588ad56066b1e552b895f3a24.tar.gz pleroma-4ac6e6283f6e090588ad56066b1e552b895f3a24.zip | |
Merge branch 'develop' into 'admin-api-user-credentials-for-remote-users-fix'
# Conflicts:
# CHANGELOG.md
Diffstat (limited to 'priv/repo/migrations/20200708193702_drop_user_trigram_index.exs')
| -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 |
