"""cards_title_trgm_index

Revision: 0097
Revision ID: 4e63e5c80ada
Revises: 5397fd6fbb4d
Create Date: 2017-06-20 17:01:58.608162

"""

# revision identifiers, used by Alembic.
revision = '4e63e5c80ada'
down_revision = '5397fd6fbb4d'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.execute("CREATE EXTENSION IF NOT EXISTS pg_trgm;")
    op.execute("CREATE INDEX cards_title_trgm_idx ON cards USING gin(title gin_trgm_ops);")


def downgrade():
    op.execute("DROP INDEX cards_title_trgm_idx")
