"""empty message

Revision ID: 0e3584072c53
Revises: 73d4d11c7474
Create Date: 2020-07-14 20:51:08.983030

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql

# revision identifiers, used by Alembic.
revision = '0e3584072c53'
down_revision = '73d4d11c7474'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('marks', sa.Column('mark', sa.Integer(), nullable=True))
    op.add_column('marks', sa.Column('student_id', sa.Integer(), nullable=True))
    op.drop_index('mark_value', table_name='marks')
    op.create_unique_constraint(None, 'marks', ['mark'])
    op.create_foreign_key(None, 'marks', 'students', ['student_id'], ['id'])
    op.drop_column('marks', 'mark_name')
    op.drop_column('marks', 'mark_value')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('marks', sa.Column('mark_value', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
    op.add_column('marks', sa.Column('mark_name', mysql.VARCHAR(length=60), nullable=True))
    op.drop_constraint(None, 'marks', type_='foreignkey')
    op.drop_constraint(None, 'marks', type_='unique')
    op.create_index('mark_value', 'marks', ['mark_value'], unique=True)
    op.drop_column('marks', 'student_id')
    op.drop_column('marks', 'mark')
    # ### end Alembic commands ###
