STRAWBERRY

/claim #7528

What this fixes

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.

Changes

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.

Tests

Two Pest feature tests in tests/Feature/ApplicationComposeDatabaseBackupsTest.php:

  • Parse with a Postgres service creates a ServiceDatabase row with the correct application_id
  • Re-parse with the DB service removed deletes the stale row and its scheduled backups

Both pass: docker exec coolify php artisan test --compact tests/Feature/ApplicationComposeDatabaseBackupsTest.php

Demo

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.


  • I have read the contributing guidelines
  • I tested my changes locally
  • I accept that this contribution will be MIT licensed

AI assistance used: Yes — Cursor (implementation) and Claude Code (architecture review, migration safety, Skeptic gate). All code reviewed and tested manually.

Claim

Total prize pool $100
Total paid $0
Status Pending
Submitted March 17, 2026
Last updated March 17, 2026

Contributors

EN

Enkae

@enkae-code

100%

Sponsors

IL

Ilias Ism

@me

$100