summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20190115085500_create_user_fts_index.exs
diff options
context:
space:
mode:
Diffstat (limited to 'priv/repo/migrations/20190115085500_create_user_fts_index.exs')
-rw-r--r--priv/repo/migrations/20190115085500_create_user_fts_index.exs24
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