kemono2/db/migrations/20210214_01_IljvB-index-posts-for-search.py

15 lines
316 B
Python
Raw Normal View History

2024-07-04 21:57:05 +02:00
"""
Index posts for search
"""
from yoyo import step
__depends__ = {"20210120_01_PZzeb-apply-primary-key-constraint-to-lookup-table"}
steps = [
step(
"CREATE INDEX IF NOT EXISTS search_idx ON posts USING GIN (to_tsvector('english', content || ' ' || title))",
"DROP INDEX search_idx",
)
]