STRAWBERRY
/claim #7528
Docker Compose applications with database services (Postgres, MySQL, MariaDB, MongoDB) couldn’t use scheduled backups. The backup system only knew about ServiceDatabase rows linked via service_id — Application-type compose deployments never wrote those rows, so backup jobs had no container to target and the UI had nothing to show.
Migration — adds a nullable application_id FK to service_databases. Either service_id or application_id must be set (XOR, enforced via CHECK constraint on Postgres). Rollback deletes application-linked rows first to satisfy the restored NOT NULL on service_id, with that behavior documented in the class docblock.
Parser (parseDockerComposeFile in shared.php) — when the resource is an Application, database services now get persisted as ServiceDatabase rows linked by application_id. On re-parse, any rows whose service names no longer appear in the compose file get deleted along with their scheduled backups. The cleanup only runs when at least one service parsed successfully, so a failed parse doesn’t wipe anything.
Backup job (DatabaseBackupJob) — routes server and network resolution through the Application when application_id is set. Added a deployment guard: if an application deployment is in progress when a backup fires, the job re-queues itself with a 5-minute delay rather than running against a container mid-restart.
UI — a Backups page (project.application.database-backups) reuses the existing livewire:project.database.scheduled-backups component, passing the resolved ServiceDatabase instance. A Backups link appears in the Docker Compose configuration view next to each detected database service.
Two Pest feature tests in tests/Feature/ApplicationComposeDatabaseBackupsTest.php:
ServiceDatabase row with the correct application_idBoth pass: docker exec coolify php artisan test --compact tests/Feature/ApplicationComposeDatabaseBackupsTest.php
Note to reviewer: Screenshot/video of the backup UI in action will be added here before merge review. The Backups link appears in the Docker Compose configuration page under each detected database service, opening a page that reuses the existing scheduled backup management UI.
AI assistance used: Yes — Cursor (implementation) and Claude Code (architecture review, migration safety, Skeptic gate). All code reviewed and tested manually.
Enkae
@enkae-code
Ilias Ism
@me