"""Payment customer name

Revision ID: 6f16d1452854
Revises: f81ad9d98879
Create Date: 2017-08-21 09:49:39.836000

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6f16d1452854'
down_revision = u'f81ad9d98879'
branch_labels = None
depends_on = None

first_agent_version = '17.8.22'


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

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

    with op.batch_alter_table('held_payments') as batch_op:
        batch_op.add_column(sa.Column('full_name', sa.String(length=128), nullable=True))

    with op.batch_alter_table('payments') as batch_op:
        batch_op.add_column(sa.Column('full_name', sa.String(length=128), 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('payments') as batch_op:
        batch_op.drop_column('full_name')

    with op.batch_alter_table('held_payments') as batch_op:
        batch_op.drop_column('full_name')
