"""empty message

Revision ID: 40aae59fea91
Revises: ab94ede1e794
Create Date: 2019-04-23 15:40:18.927557

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '40aae59fea91'
down_revision = 'ab94ede1e794'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('plano_saude',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('descricao', sa.String(length=100), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('plano_saude_paciente',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('no_carteira', sa.String(length=50), nullable=False),
    sa.Column('dt_validade', sa.DateTime(), nullable=False),
    sa.Column('paciente_id', sa.Integer(), nullable=True),
    sa.Column('ps_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['paciente_id'], ['paciente.id'], ),
    sa.ForeignKeyConstraint(['ps_id'], ['plano_saude.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('prontuario',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('profissional_id', sa.Integer(), nullable=True),
    sa.Column('cliente_id', sa.Integer(), nullable=True),
    sa.Column('dt_atendimento', sa.DateTime(), nullable=True),
    sa.Column('conteudo', sa.Text(), nullable=True),
    sa.ForeignKeyConstraint(['cliente_id'], ['paciente.id'], ),
    sa.ForeignKeyConstraint(['profissional_id'], ['profissional.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


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