"""empty message

Revision ID: 7fb4b781bbd7
Revises: 
Create Date: 2019-07-29 21:55:01.738177

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('class_info',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.Text(), nullable=True),
    sa.Column('units', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('instructor',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.Text(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('schedule',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('time_slot',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('start_time', sa.Time(), nullable=True),
    sa.Column('end_time', sa.Time(), nullable=True),
    sa.Column('day_of_week', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('class_schedule',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('code', sa.Integer(), nullable=True),
    sa.Column('class_info_id', sa.Integer(), nullable=True),
    sa.Column('schedule_id', sa.Integer(), nullable=True),
    sa.Column('available_slots', sa.Integer(), nullable=True),
    sa.Column('total_slots', sa.Integer(), nullable=True),
    sa.Column('demand', sa.Integer(), nullable=True),
    sa.Column('restrictions', sa.Text(), nullable=True),
    sa.Column('remarks', sa.Text(), nullable=True),
    sa.Column('last_updated', sa.Time(), nullable=True),
    sa.ForeignKeyConstraint(['class_info_id'], ['class_info.id'], ),
    sa.ForeignKeyConstraint(['schedule_id'], ['schedule.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('schedule_timeslot_association',
    sa.Column('time_slot_id', sa.Integer(), nullable=True),
    sa.Column('schedule_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['schedule_id'], ['schedule.id'], ),
    sa.ForeignKeyConstraint(['time_slot_id'], ['time_slot.id'], )
    )
    op.create_table('instructor_class_schedule_association',
    sa.Column('instructor_id', sa.Integer(), nullable=True),
    sa.Column('class_schedule_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['class_schedule_id'], ['class_schedule.id'], ),
    sa.ForeignKeyConstraint(['instructor_id'], ['instructor.id'], )
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('instructor_class_schedule_association')
    op.drop_table('schedule_timeslot_association')
    op.drop_table('class_schedule')
    op.drop_table('time_slot')
    op.drop_table('schedule')
    op.drop_table('instructor')
    op.drop_table('class_info')
    # ### end Alembic commands ###
