diff options
| author | Maxim Filippov <colixer@gmail.com> | 2019-10-10 03:33:55 +0300 | 
|---|---|---|
| committer | Maxim Filippov <colixer@gmail.com> | 2019-10-10 03:33:55 +0300 | 
| commit | 24eecc3cb4a35376124b1fc792183d8b8dd0a9cc (patch) | |
| tree | eac6f8b374bab49869de8bd0496e09938c9a65fa /priv/repo/migrations/20190115085500_create_user_fts_index.exs | |
| parent | aa7fd616c7cfeb84551af2170886856a815dc498 (diff) | |
| parent | 9fd5176c35d21846fb8368ea7bc0285f9cd74ad4 (diff) | |
| download | pleroma-24eecc3cb4a35376124b1fc792183d8b8dd0a9cc.tar.gz pleroma-24eecc3cb4a35376124b1fc792183d8b8dd0a9cc.zip | |
Merge branch 'develop' into feature/reports-groups-and-multiple-state-update
Diffstat (limited to 'priv/repo/migrations/20190115085500_create_user_fts_index.exs')
| -rw-r--r-- | priv/repo/migrations/20190115085500_create_user_fts_index.exs | 24 | 
1 files changed, 13 insertions, 11 deletions
| diff --git a/priv/repo/migrations/20190115085500_create_user_fts_index.exs b/priv/repo/migrations/20190115085500_create_user_fts_index.exs index cff975318..0c0c512d3 100644 --- a/priv/repo/migrations/20190115085500_create_user_fts_index.exs +++ b/priv/repo/migrations/20190115085500_create_user_fts_index.exs @@ -2,16 +2,18 @@ defmodule Pleroma.Repo.Migrations.CreateUserFtsIndex do    use Ecto.Migration    def change do -    create_if_not_exists index( -             :users, -             [ -               """ -               (setweight(to_tsvector('simple', regexp_replace(nickname, '\\W', ' ', 'g')), 'A') || -               setweight(to_tsvector('simple', regexp_replace(coalesce(name, ''), '\\W', ' ', 'g')), 'B')) -               """ -             ], -             name: :users_fts_index, -             using: :gin -           ) +    create_if_not_exists( +      index( +        :users, +        [ +          """ +          (setweight(to_tsvector('simple', regexp_replace(nickname, '\\W', ' ', 'g')), 'A') || +          setweight(to_tsvector('simple', regexp_replace(coalesce(name, ''), '\\W', ' ', 'g')), 'B')) +          """ +        ], +        name: :users_fts_index, +        using: :gin +      ) +    )    end  end | 
