summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20190115085500_create_user_fts_index.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2019-10-21 14:19:15 +0700
committerEgor Kislitsyn <egor@kislitsyn.com>2019-10-21 14:19:15 +0700
commit4ea1a61b008c932bc83fcd6cd07bb7f4c251204a (patch)
treec763bd3a2a21ee3e40384ee323076bbb577b7ccb /priv/repo/migrations/20190115085500_create_user_fts_index.exs
parent8ad015ef64e0d2a4cd9f2979ff08d28be3a635e5 (diff)
parent62e3d76a450c1b34ba8d0c88a184ec861ed90f29 (diff)
downloadpleroma-4ea1a61b008c932bc83fcd6cd07bb7f4c251204a.tar.gz
pleroma-4ea1a61b008c932bc83fcd6cd07bb7f4c251204a.zip
Merge branch 'develop' into refactor/following-relationships
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