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.

20 lines
471B

  1. defmodule Pleroma.Repo.Migrations.CreateUserFtsIndex do
  2. use Ecto.Migration
  3. def change do
  4. create_if_not_exists(
  5. index(
  6. :users,
  7. [
  8. """
  9. (setweight(to_tsvector('simple', regexp_replace(nickname, '\\W', ' ', 'g')), 'A') ||
  10. setweight(to_tsvector('simple', regexp_replace(coalesce(name, ''), '\\W', ' ', 'g')), 'B'))
  11. """
  12. ],
  13. name: :users_fts_index,
  14. using: :gin
  15. )
  16. )
  17. end
  18. end