Without cascade, SQLAlchemy tried to NULL-out foreign keys on child rows before deleting the parent, hitting NOT NULL constraints in PostgreSQL. - Routine.steps: cascade="all, delete-orphan" (routine_steps.routine_id) - MedicationEntry.usage_history: cascade="all, delete-orphan" (medication_usages.medication_record_id) Product.inventory already had cascade set correctly. No DB migration needed — ORM-level only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| api | ||
| models | ||
| llm.py | ||
| mcp_server.py | ||