Skip to content
Snippets Groups Projects
Commit bd349e79 authored by roadscape's avatar roadscape
Browse files

comm ft idx

parent c77ad1ee
No related branches found
No related tags found
No related merge requests found
......@@ -311,6 +311,10 @@ class DbState:
cls.db().query("CREATE INDEX hive_notifs_ix6 ON hive_notifs (dst_id, created_at, score, id) WHERE dst_id IS NOT NULL")
cls._set_ver(16)
if cls._ver == 16:
cls.db().query("CREATE INDEX hive_communities_ft1 ON hive_communities USING GIN (to_tsvector('english', title || ' ' || about))")
cls._set_ver(17)
reset_autovac(cls.db())
log.info("[HIVE] db version: %d", cls._ver)
......
......@@ -10,7 +10,7 @@ from sqlalchemy.types import BOOLEAN
#pylint: disable=line-too-long, too-many-lines, bad-whitespace
DB_VERSION = 16
DB_VERSION = 17
def build_metadata():
"""Build schema def with SqlAlchemy"""
......@@ -341,6 +341,9 @@ def setup(db):
for sql in sqls:
db.query(sql)
sql = "CREATE INDEX hive_communities_ft1 ON hive_communities USING GIN (to_tsvector('english', title || ' ' || about))"
db.query(sql)
def reset_autovac(db):
"""Initializes/resets per-table autovacuum/autoanalyze params.
......
......@@ -119,7 +119,8 @@ disable=
coerce-method,
#custom
fixme,
multiple-statements
multiple-statements,
import-outside-toplevel
[REPORTS]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment