"""add text search index to message log

Revision ID: 1318268acd94
Revises: 7cef3442efe1
Create Date: 2019-08-01 13:11:33.185942

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '1318268acd94'
down_revision = '7cef3442efe1'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index('ix_text_tsv', 'message', [sa.text("to_tsvector('english', text)")], unique=False, postgresql_using='gin')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index('ix_text_tsv', table_name='message')
    # ### end Alembic commands ###
