"""empty message

Revision ID: c2cf494d67b8
Revises: 
Create Date: 2021-06-17 19:28:43.586063

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('residencia',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('nombre', sa.String(length=20), nullable=False),
    sa.Column('direccion', sa.String(length=80), nullable=False),
    sa.Column('no_habitaciones', sa.Integer(), nullable=True),
    sa.Column('director', sa.String(length=20), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('usuario',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user', sa.String(length=80), nullable=True),
    sa.Column('password', sa.String(length=8), nullable=False),
    sa.Column('es_admin', sa.Boolean(), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('user')
    )
    op.create_table('paciente',
    sa.Column('dni', sa.Integer(), nullable=False),
    sa.Column('nombre', sa.String(length=80), nullable=False),
    sa.Column('apellido', sa.String(length=80), nullable=False),
    sa.Column('edad', sa.Integer(), nullable=False),
    sa.Column('habitacion', sa.Integer(), nullable=False),
    sa.Column('residencia', sa.Integer(), nullable=False),
    sa.Column('usuario', sa.String(length=80), nullable=True),
    sa.ForeignKeyConstraint(['residencia'], ['residencia.id'], ),
    sa.ForeignKeyConstraint(['usuario'], ['usuario.user'], ),
    sa.PrimaryKeyConstraint('dni')
    )
    op.create_table('personal',
    sa.Column('dni', sa.Integer(), nullable=False),
    sa.Column('nombre', sa.String(length=80), nullable=False),
    sa.Column('apellido', sa.String(length=80), nullable=False),
    sa.Column('titulo', sa.String(length=80), nullable=False),
    sa.Column('especialidad', sa.String(length=80), nullable=False),
    sa.Column('usuario', sa.String(length=80), nullable=True),
    sa.Column('residencia', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['residencia'], ['residencia.id'], ),
    sa.ForeignKeyConstraint(['usuario'], ['usuario.user'], ),
    sa.PrimaryKeyConstraint('dni')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('personal')
    op.drop_table('paciente')
    op.drop_table('usuario')
    op.drop_table('residencia')
    # ### end Alembic commands ###
