mirror of
https://github.com/lrnselfreliance/wrolpi.git
synced 2026-10-26 19:01:39 -04:00
Creating index for video textsearch.
This commit is contained in:
parent
e3fd85ff97
commit
fea2ca27b0
1 changed files with 31 additions and 0 deletions
31
alembic/versions/bddb5e95a91e_video_textsearch_index.py
Normal file
31
alembic/versions/bddb5e95a91e_video_textsearch_index.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
"""Video textsearch index
|
||||
|
||||
Revision ID: bddb5e95a91e
|
||||
Revises: db0a1560d923
|
||||
Create Date: 2021-12-31 18:12:00.407694
|
||||
|
||||
"""
|
||||
import os
|
||||
|
||||
from alembic import op
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'bddb5e95a91e'
|
||||
down_revision = 'db0a1560d923'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
DOCKERIZED = True if os.environ.get('DOCKER', '').lower().startswith('t') else False
|
||||
|
||||
|
||||
def upgrade():
|
||||
bind = op.get_bind()
|
||||
session = Session(bind=bind)
|
||||
session.execute('CREATE INDEX IF NOT EXISTS video_textsearch_idx ON video USING GIN(textsearch)')
|
||||
|
||||
|
||||
def downgrade():
|
||||
bind = op.get_bind()
|
||||
session = Session(bind=bind)
|
||||
session.execute('DROP INDEX IF EXISTS video_textsearch_idx')
|
||||
Loading…
Add table
Add a link
Reference in a new issue