"""update workflow_scripts wpid index

Revision ID: ee2f523ea454
Revises: f54bab75b1c4
Create Date: 2025-08-31 06:06:13.611883+00:00

"""

from typing import Sequence, Union

from alembic import op

# revision identifiers, used by Alembic.
revision: str = "ee2f523ea454"
down_revision: Union[str, None] = "f54bab75b1c4"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("idx_workflow_scripts_workflow_permanent_id"), table_name="workflow_scripts")
    op.create_index(
        "idx_workflow_scripts_wpid_cache_key_value",
        "workflow_scripts",
        ["workflow_permanent_id", "cache_key_value"],
        unique=False,
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index("idx_workflow_scripts_wpid_cache_key_value", table_name="workflow_scripts")
    op.create_index(
        op.f("idx_workflow_scripts_workflow_permanent_id"), "workflow_scripts", ["workflow_permanent_id"], unique=False
    )
    # ### end Alembic commands ###
