"""empty message

Revision ID: 993e77f90660
Revises: b32acc6d179f
Create Date: 2021-06-21 20:51:16.400265

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
from video_discovery.models.types.tsvector import TSVector

revision = '993e77f90660'
down_revision = 'b32acc6d179f'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('video', sa.Column('__ts_vector__', TSVector(),
                                     sa.Computed("to_tsvector('english', title || ' ' || description)", persisted=True),
                                     nullable=True))
    op.create_index('ix_video___ts_vector__', 'video', ['__ts_vector__'], unique=False, postgresql_using='gin')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_video___ts_vector__', table_name='video', postgresql_using='gin')
    op.drop_column('video', '__ts_vector__')
    # ### end Alembic commands ###
