logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://anongit.hacktivis.me/git/pleroma.git/

20200708193702_drop_user_trigram_index.exs (618B)


  1. # Pleroma: A lightweight social networking server
  2. # Copyright © 2017-2022 Pleroma Authors <https://pleroma.social/>
  3. # SPDX-License-Identifier: AGPL-3.0-only
  4. defmodule Pleroma.Repo.Migrations.DropUserTrigramIndex do
  5. @moduledoc "Drops unused trigram index on `users` (FTS index is being used instead)"
  6. use Ecto.Migration
  7. def up do
  8. drop_if_exists(index(:users, [], name: :users_trigram_index))
  9. end
  10. def down do
  11. create_if_not_exists(
  12. index(:users, ["(trim(nickname || ' ' || coalesce(name, ''))) gist_trgm_ops"],
  13. name: :users_trigram_index,
  14. using: :gist
  15. )
  16. )
  17. end
  18. end