summaryrefslogtreecommitdiff
path: root/priv/repo/migrations/20190115085500_create_user_fts_index.exs
diff options
context:
space:
mode:
authorMaxim Filippov <colixer@gmail.com>2019-10-11 15:59:35 +0300
committerMaxim Filippov <colixer@gmail.com>2019-10-11 15:59:35 +0300
commitc0aca32dd0aed522cfc537cc88b77f7ff254946b (patch)
tree352f8d034c0325d370417070cec43eb32376656d /priv/repo/migrations/20190115085500_create_user_fts_index.exs
parentaaa4252f416fbad099f95232de4cf6eab11dd7d2 (diff)
parent44afe4c8870d14ae2cd22ff5cfa04555cf5907bd (diff)
downloadpleroma-c0aca32dd0aed522cfc537cc88b77f7ff254946b.tar.gz
pleroma-c0aca32dd0aed522cfc537cc88b77f7ff254946b.zip
Merge branch 'develop' into feature/multiple-users-activation-permissions
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