"""empty message

Revision ID: ba01c7e0f8ef
Revises: 661f93df45e2
Create Date: 2019-04-17 09:44:29.711303

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'ba01c7e0f8ef'
down_revision = '661f93df45e2'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('prontuario_legado', sa.Column('paciente_id', sa.Integer(), nullable=True))
    op.drop_constraint('prontuario_legado_cliente_id_fkey', 'prontuario_legado', type_='foreignkey')
    op.create_foreign_key(None, 'prontuario_legado', 'paciente', ['paciente_id'], ['id'])
    op.drop_column('prontuario_legado', 'cliente_id')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('prontuario_legado', sa.Column('cliente_id', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'prontuario_legado', type_='foreignkey')
    op.create_foreign_key('prontuario_legado_cliente_id_fkey', 'prontuario_legado', 'paciente', ['cliente_id'], ['id'])
    op.drop_column('prontuario_legado', 'paciente_id')
    # ### end Alembic commands ###
