20260724_260_active_dataflow_execution.py 764 B

123456789101112131415161718192021222324252627
  1. """Add governed active-production execution operations."""
  2. from alembic import op
  3. revision = "20260724_260"
  4. down_revision = "20260724_250"
  5. branch_labels = None
  6. depends_on = None
  7. def upgrade() -> None:
  8. op.execute(
  9. """
  10. ALTER TABLE public.dataflow_deployment_operations
  11. DROP CONSTRAINT dataflow_deployment_operations_action_check;
  12. ALTER TABLE public.dataflow_deployment_operations
  13. ADD CONSTRAINT dataflow_deployment_operations_action_check
  14. CHECK (action IN (
  15. 'deploy_disabled','run_canary','activate','rollback',
  16. 'execute_active'
  17. ));
  18. """
  19. )
  20. def downgrade() -> None:
  21. raise RuntimeError("active production execution audit is forward-only")