Moved mail deletion to after job deletion to avoid foreign key constraint violations. The job_runs have a foreign key to mail_messages, so jobs (and their cascaded runs) must be deleted first before the mails can be deleted. Correct order: 1. Clean up auxiliary tables (ticket_job_runs, remark_job_runs, etc) 2. Delete jobs (cascades to runs via ORM) 3. Delete mails (no more foreign key references) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| backupchecks | ||