mirror of
https://github.com/rennf93/roboco.git
synced 2026-08-03 07:23:24 +02:00
016_add_products_and_task_product_id used `sa.Enum(..., create_type=False)` for the reused Postgres "team" enum — the same latent defect that crashed 052 on a real orchestrator boot. On the generic `sa.Enum` the `create_type` kwarg is silently dropped, so `_check_for_name_in_memos` never sees it and `op.create_table` (checkfirst=False) emits a redundant `CREATE TYPE team` that fails with "type 'team' already exists" against a DB where the enum pre-exists. Switch to the postgres-native `postgresql.ENUM(..., create_type=False)` — its `create_type` is a real attribute the guard reads, so the CREATE TYPE is suppressed (and DROP TYPE on downgrade too). The member list is inert under create_type=False (it never creates/alters the type), so it stays at 016's original six, reflecting the enum as it stood then, not the later-widened set. This never crashed in prod because 016 is never re-run (alembic_version is past it), but it's the same defect class. Verified on the real boot path: upgrade to 015 in process A (team enum created by 001), then `upgrade head` in a fresh process B — 016 applied clean, no DuplicateObjectError; downgrade 016->015 clean, shared team enum preserved. See project_migration_enum_create_type_gotcha.