7a12cba4d5
TaskStatus enum was missing 'cancelled' — the LLM tried to use it and
hit TaskStatus("cancelled") raising ValueError → 500. Added the value,
a migration to extend the task_status Postgres enum, and proper 400
validation guards on both create and update task routes.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
19 lines
437 B
Python
19 lines
437 B
Python
"""Add 'cancelled' value to task_status enum."""
|
|
|
|
from alembic import op
|
|
|
|
revision = "0031"
|
|
down_revision = "0030"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.execute("ALTER TYPE task_status ADD VALUE IF NOT EXISTS 'cancelled'")
|
|
|
|
|
|
def downgrade() -> None:
|
|
# PostgreSQL does not support removing enum values without a full type rebuild.
|
|
# Downgrade is a no-op; the value simply becomes unused.
|
|
pass
|