"""empty message

Revision ID: f963ab1f5eb7
Revises: 
Create Date: 2019-05-17 23:35:02.789048

"""
from alembic import op
import sqlalchemy as sa
import sqlalchemy_utils
from models import Accounts

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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('Customers',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('first_name', sqlalchemy_utils.types.encrypted.encrypted_type.EncryptedType(), nullable=True),
    sa.Column('last_name', sqlalchemy_utils.types.encrypted.encrypted_type.EncryptedType(), nullable=True),
    sa.Column('phone_number', sqlalchemy_utils.types.encrypted.encrypted_type.EncryptedType(), nullable=True),
    sa.Column('email', sqlalchemy_utils.types.encrypted.encrypted_type.EncryptedType(), nullable=True),
    sa.Column('ssn', sqlalchemy_utils.types.encrypted.encrypted_type.EncryptedType(), nullable=True),
    sa.Column('active', sa.Boolean(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('Accounts',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('customer_id', sa.Integer(), nullable=True),
    sa.Column('account_type', sqlalchemy_utils.types.choice.ChoiceType(Accounts.account_types_choices), nullable=True),
    sa.Column('balance', sa.Float(), nullable=True),
    sa.Column('account_number', sa.String(), nullable=True),
    sa.Column('routing_number', sa.String(), nullable=True),
    sa.Column('status', sqlalchemy_utils.types.choice.ChoiceType(Accounts.status_choices), nullable=True),
    sa.Column('active', sa.Boolean(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['customer_id'], ['Customers.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('account_number')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('Accounts')
    op.drop_table('Customers')
    # ### end Alembic commands ###
