Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
570B

  1. defmodule Pleroma.Repo.Migrations.FixUserTrigramIndex do
  2. use Ecto.Migration
  3. def up do
  4. drop_if_exists(index(:users, [], name: :users_trigram_index))
  5. create_if_not_exists(
  6. index(:users, ["(trim(nickname || ' ' || coalesce(name, ''))) gist_trgm_ops"],
  7. name: :users_trigram_index,
  8. using: :gist
  9. )
  10. )
  11. end
  12. def down do
  13. drop_if_exists(index(:users, [], name: :users_trigram_index))
  14. create_if_not_exists(
  15. index(:users, ["(nickname || name) gist_trgm_ops"], name: :users_trigram_index, using: :gist)
  16. )
  17. end
  18. end