Added UPDATE to set mail_messages.job_id = NULL before deleting jobs to avoid foreign key constraint violation. The mail_messages table has a foreign key to jobs, so we must unlink them first. Complete correct order: 1. Clean up auxiliary tables 2. Unlink mails from jobs (SET job_id = NULL) 3. Delete jobs (cascades to runs) 4. Delete mails Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| backupchecks | ||