<reponame>OpenPaymentNetwork/FerlySite
"""Add tsvector to design table

Revision ID: 0001
Revises: 0000
Create Date: 2019-01-29 11:51:34.595614

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '0001'
down_revision = '0000'
branch_labels = None
depends_on = None


def upgrade():
    op.add_column('design', sa.Column('tsvector', postgresql.TSVECTOR(), nullable=True))
    op.execute('UPDATE design SET tsvector=to_tsvector(title)')


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('design', 'tsvector')
    # ### end Alembic commands ###
