"""mag_card_auth

Revision ID: 83f75cbd917a
Revises:
Create Date: 2017-08-21 10:03:48.008000

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '83f75cbd917a'
down_revision = None
branch_labels = None
depends_on = None

# TODO: Set the first_agent_version correctly before merging this revision
first_agent_version = '17.8.23'


def upgrade():
    """
    Use batch-operations to support sqlite

    > with op.batch_alter_table('table_name') as batch_op:
    >     pass
    """
    with op.batch_alter_table('ticket_close_candidates') as batch_op:
        batch_op.add_column(sa.Column('auth', sa.String(length=256), nullable=True))

def downgrade():
    """
    Use batch-operations to support sqlite

    > with op.batch_alter_table('table_name') as batch_op:
    >     pass
    """

    with op.batch_alter_table('ticket_close_candidates') as batch_op:
        batch_op.drop_column('auth')
