"""fix comment table

Revision ID: <KEY>
Revises: 9a23442e6dc7
Create Date: 2020-12-21 11:32:15.343899

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '9a23442e6dc7'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('comment', schema=None) as batch_op:
        batch_op.drop_constraint('fk_comment_post_id_post', type_='foreignkey')
        batch_op.create_foreign_key(batch_op.f('fk_comment_post_id_post'), 'post', ['post_id'], ['id'], ondelete='CASCADE')

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('comment', schema=None) as batch_op:
        batch_op.drop_constraint(batch_op.f('fk_comment_post_id_post'), type_='foreignkey')
        batch_op.create_foreign_key('fk_comment_post_id_post', 'post', ['post_id'], ['id'])

    # ### end Alembic commands ###

"""fix comment table

Revision ID: <KEY>
Revises: 9a23442e6dc7
Create Date: 2020-12-21 11:32:15.343899

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = '9a23442e6dc7'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('comment', schema=None) as batch_op:
        batch_op.drop_constraint('fk_comment_post_id_post', type_='foreignkey')
        batch_op.create_foreign_key(batch_op.f('fk_comment_post_id_post'), 'post', ['post_id'], ['id'], ondelete='CASCADE')

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('comment', schema=None) as batch_op:
        batch_op.drop_constraint(batch_op.f('fk_comment_post_id_post'), type_='foreignkey')
        batch_op.create_foreign_key('fk_comment_post_id_post', 'post', ['post_id'], ['id'])

    # ### end Alembic commands ###

fix comment table  Revision ID: <KEY> Revises: 9a23442e6dc7 Create Date: 2020-12-21 11:32:15.343899 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###