"""cascade table mahasiswa

Revision ID: fa451de00599
Revises: be782e60c50b
Create Date: 2021-06-29 21:27:31.199229

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('mahasiswa_ibfk_2', 'mahasiswa', type_='foreignkey')
    op.drop_constraint('mahasiswa_ibfk_1', 'mahasiswa', type_='foreignkey')
    op.create_foreign_key(None, 'mahasiswa', 'dosen', ['second_lecturer'], ['id'], ondelete='CASCADE')
    op.create_foreign_key(None, 'mahasiswa', 'dosen', ['first_lecturer'], ['id'], ondelete='CASCADE')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, 'mahasiswa', type_='foreignkey')
    op.drop_constraint(None, 'mahasiswa', type_='foreignkey')
    op.create_foreign_key('mahasiswa_ibfk_1', 'mahasiswa', 'dosen', ['first_lecturer'], ['id'])
    op.create_foreign_key('mahasiswa_ibfk_2', 'mahasiswa', 'dosen', ['second_lecturer'], ['id'])
    # ### end Alembic commands ###
