"""empty message

Revision ID: 890e3cba623d
Revises: 5266c76b1957
Create Date: 2019-04-26 10:28:18.199139

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '890e3cba623d'
down_revision = '5266c76b1957'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('local',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('descricao', sa.String(length=100), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('horario',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('dt_inicio', sa.DateTime(), nullable=True),
    sa.Column('livre', sa.Boolean(), nullable=True),
    sa.Column('local_id', sa.Integer(), nullable=True),
    sa.Column('profissional_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['local_id'], ['local.id'], ),
    sa.ForeignKeyConstraint(['profissional_id'], ['profissional.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('consulta',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('dt_marcacao', sa.DateTime(), nullable=True),
    sa.Column('compareceu', sa.Boolean(), nullable=True),
    sa.Column('confirmacao_consulta_sms', sa.Boolean(), nullable=True),
    sa.Column('paciente_id', sa.Integer(), nullable=True),
    sa.Column('profissional_id', sa.Integer(), nullable=True),
    sa.Column('horario_id', sa.Integer(), nullable=True),
    sa.Column('convenio_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['convenio_id'], ['plano_saude_paciente.id'], ),
    sa.ForeignKeyConstraint(['horario_id'], ['horario.id'], ),
    sa.ForeignKeyConstraint(['paciente_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('consulta')
    op.drop_table('horario')
    op.drop_table('local')
    # ### end Alembic commands ###
