<reponame>stevenc987/sbc-pay
"""bcol_changes

Revision ID: 41bf37772240
Revises: <KEY>
Create Date: 2020-01-29 16:15:07.585449

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('payment_account', sa.Column('auth_account_id', sa.String(length=50), nullable=True))
    op.add_column('payment_account', sa.Column('bcol_account_id', sa.String(length=50), nullable=True))
    op.add_column('payment_account', sa.Column('bcol_user_id', sa.String(length=50), nullable=True))
    op.alter_column('payment_account', 'corp_number',
               existing_type=sa.VARCHAR(length=20),
               nullable=True)
    op.alter_column('payment_account', 'corp_type_code',
               existing_type=sa.VARCHAR(length=10),
               nullable=True)
    op.create_index(op.f('ix_payment_account_auth_account_id'), 'payment_account', ['auth_account_id'], unique=False)
    op.create_index(op.f('ix_payment_account_bcol_account_id'), 'payment_account', ['bcol_account_id'], unique=False)
    op.create_index(op.f('ix_payment_account_bcol_user_id'), 'payment_account', ['bcol_user_id'], unique=False)
    op.drop_index('ix_payment_account_user_id', table_name='payment_account')
    op.drop_column('payment_account', 'user_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('payment_account', sa.Column('user_id', sa.VARCHAR(length=50), autoincrement=False, nullable=True))
    op.create_index('ix_payment_account_user_id', 'payment_account', ['user_id'], unique=False)
    op.drop_index(op.f('ix_payment_account_bcol_user_id'), table_name='payment_account')
    op.drop_index(op.f('ix_payment_account_bcol_account_id'), table_name='payment_account')
    op.drop_index(op.f('ix_payment_account_auth_account_id'), table_name='payment_account')
    op.alter_column('payment_account', 'corp_type_code',
               existing_type=sa.VARCHAR(length=10),
               nullable=False)
    op.alter_column('payment_account', 'corp_number',
               existing_type=sa.VARCHAR(length=20),
               nullable=False)
    op.drop_column('payment_account', 'bcol_user_id')
    op.drop_column('payment_account', 'bcol_account_id')
    op.drop_column('payment_account', 'auth_account_id')
    # ### end Alembic commands ###

"""bcol_changes

Revision ID: 41bf37772240
Revises: <KEY>
Create Date: 2020-01-29 16:15:07.585449

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '<KEY>'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('payment_account', sa.Column('auth_account_id', sa.String(length=50), nullable=True))
    op.add_column('payment_account', sa.Column('bcol_account_id', sa.String(length=50), nullable=True))
    op.add_column('payment_account', sa.Column('bcol_user_id', sa.String(length=50), nullable=True))
    op.alter_column('payment_account', 'corp_number',
               existing_type=sa.VARCHAR(length=20),
               nullable=True)
    op.alter_column('payment_account', 'corp_type_code',
               existing_type=sa.VARCHAR(length=10),
               nullable=True)
    op.create_index(op.f('ix_payment_account_auth_account_id'), 'payment_account', ['auth_account_id'], unique=False)
    op.create_index(op.f('ix_payment_account_bcol_account_id'), 'payment_account', ['bcol_account_id'], unique=False)
    op.create_index(op.f('ix_payment_account_bcol_user_id'), 'payment_account', ['bcol_user_id'], unique=False)
    op.drop_index('ix_payment_account_user_id', table_name='payment_account')
    op.drop_column('payment_account', 'user_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('payment_account', sa.Column('user_id', sa.VARCHAR(length=50), autoincrement=False, nullable=True))
    op.create_index('ix_payment_account_user_id', 'payment_account', ['user_id'], unique=False)
    op.drop_index(op.f('ix_payment_account_bcol_user_id'), table_name='payment_account')
    op.drop_index(op.f('ix_payment_account_bcol_account_id'), table_name='payment_account')
    op.drop_index(op.f('ix_payment_account_auth_account_id'), table_name='payment_account')
    op.alter_column('payment_account', 'corp_type_code',
               existing_type=sa.VARCHAR(length=10),
               nullable=False)
    op.alter_column('payment_account', 'corp_number',
               existing_type=sa.VARCHAR(length=20),
               nullable=False)
    op.drop_column('payment_account', 'bcol_user_id')
    op.drop_column('payment_account', 'bcol_account_id')
    op.drop_column('payment_account', 'auth_account_id')
    # ### end Alembic commands ###
bcol_changes  Revision ID: 41bf37772240 Revises: <KEY> Create Date: 2020-01-29 16:15:07.585449 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###