"""empty message

Revision ID: d92933428914
Revises: 
Create Date: 2018-05-10 02:21:58.430671

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('courses',
    sa.Column('cid', sa.Integer(), nullable=False),
    sa.Column('cname', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('cid')
    )
    op.create_table('departments',
    sa.Column('did', sa.Integer(), nullable=False),
    sa.Column('dname', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('did')
    )
    op.create_table('professors',
    sa.Column('pid', sa.Integer(), nullable=False),
    sa.Column('pname', sa.String(length=128), nullable=True),
    sa.Column('nuggets', sa.Integer(), nullable=True),
    sa.Column('score', sa.Numeric(precision=2), nullable=True),
    sa.Column('nrev', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('pid')
    )
    op.create_table('course_department',
    sa.Column('did', sa.Integer(), nullable=True),
    sa.Column('cid', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['cid'], ['courses.cid'], ),
    sa.ForeignKeyConstraint(['did'], ['departments.did'], )
    )
    op.create_table('professor_course',
    sa.Column('pid', sa.Integer(), nullable=True),
    sa.Column('cid', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['cid'], ['courses.cid'], ),
    sa.ForeignKeyConstraint(['pid'], ['professors.pid'], )
    )
    op.create_table('professor_department',
    sa.Column('did', sa.Integer(), nullable=True),
    sa.Column('pid', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['did'], ['departments.did'], ),
    sa.ForeignKeyConstraint(['pid'], ['professors.pid'], )
    )
    op.create_table('reviews',
    sa.Column('rid', sa.Integer(), nullable=False),
    sa.Column('date', sa.DateTime(), nullable=True),
    sa.Column('text', sa.String(), nullable=True),
    sa.Column('agree', sa.Numeric(), nullable=True),
    sa.Column('disagree', sa.Numeric(), nullable=True),
    sa.Column('funny', sa.Numeric(), nullable=True),
    sa.Column('workload', sa.String(), nullable=True),
    sa.Column('workload_label', sa.Integer(), nullable=True),
    sa.Column('review_label', sa.Integer(), nullable=True),
    sa.Column('cid', sa.Integer(), nullable=True),
    sa.Column('pid', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['cid'], ['courses.cid'], ),
    sa.ForeignKeyConstraint(['pid'], ['professors.pid'], ),
    sa.PrimaryKeyConstraint('rid')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('reviews')
    op.drop_table('professor_department')
    op.drop_table('professor_course')
    op.drop_table('course_department')
    op.drop_table('professors')
    op.drop_table('departments')
    op.drop_table('courses')
    # ### end Alembic commands ###
