"""add_crew_ai_agent_type_agents_table

Revision ID: bdc5d363e2e1
Revises: 6db4a526335b
Create Date: 2025-05-14 06:23:14.701878

"""

from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


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


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint("check_agent_type", "agents", type_="check")
    op.create_check_constraint(
        "check_agent_type",
        "agents",
        "type IN ('llm', 'sequential', 'parallel', 'loop', 'a2a', 'workflow', 'crew_ai')",
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint("check_agent_type", "agents", type_="check")
    op.create_check_constraint(
        "check_agent_type",
        "agents",
        "type IN ('llm', 'sequential', 'parallel', 'loop', 'a2a', 'workflow')",
    )
    # ### end Alembic commands ###
