"""delete LinkUserProject ondelete Project

Revision ID: e0e717ae2f26
Revises: 40d6d6511b20
Create Date: 2025-11-17 14:33:56.348071

"""

from alembic import op

# revision identifiers, used by Alembic.
revision = "e0e717ae2f26"
down_revision = "40d6d6511b20"
branch_labels = None
depends_on = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("linkuserprojectv2", schema=None) as batch_op:
        batch_op.drop_constraint(
            batch_op.f("fk_linkuserprojectv2_project_id_projectv2"),
            type_="foreignkey",
        )
        batch_op.create_foreign_key(
            batch_op.f("fk_linkuserprojectv2_project_id_projectv2"),
            "projectv2",
            ["project_id"],
            ["id"],
            ondelete="CASCADE",
        )

    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table("linkuserprojectv2", schema=None) as batch_op:
        batch_op.drop_constraint(
            batch_op.f("fk_linkuserprojectv2_project_id_projectv2"),
            type_="foreignkey",
        )
        batch_op.create_foreign_key(
            batch_op.f("fk_linkuserprojectv2_project_id_projectv2"),
            "projectv2",
            ["project_id"],
            ["id"],
        )

    # ### end Alembic commands ###
