"""hive.swarm on delete clause

Revision ID: 9a9309eb386b
Revises: efd4c6888637
Create Date: 2023-01-28 18:25:40.558572

"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "9a9309eb386b"
down_revision = "efd4c6888637"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint("hive_swarm_id_fkey", "hive", type_="foreignkey")
    op.create_foreign_key(None, "hive", "swarm", ["swarm_id"], ["id"], ondelete="SET NULL")
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint(None, "hive", type_="foreignkey")
    op.create_foreign_key("hive_swarm_id_fkey", "hive", "swarm", ["swarm_id"], ["id"])
    # ### end Alembic commands ###
