STRAWBERRY

Changes

Database services defined inside Docker Compose applications had no way to configure or run scheduled backups. Every service-type deployment had this feature through ServiceDatabase, but Application buildpack deployments were left out entirely — the service_id FK on service_databases had no Application equivalent.

This adds end-to-end backup support for compose-app database services:

  • Migration makes service_id nullable and adds application_id FK so ServiceDatabase can be parented by either a Service or an Application (XOR enforced with a CHECK constraint on PostgreSQL)
  • parseDockerComposeFile() creates ServiceDatabase rows linked to the application when it encounters database images in a compose app
  • Orphan cleanup: if a database service is removed from the compose file on re-parse, its ServiceDatabase row and associated scheduled backup records are deleted — prevents phantom backup jobs from running
  • DatabaseBackupJob defers execution (re-queues after 5 min via release(300)) when the parent application is actively deploying
  • New Livewire page DatabaseBackups and dedicated route expose the existing scheduled-backup UI for compose-app databases
  • General settings page now lists each database service with a direct Backups link

Issues

  • Fixes #7528

Category

  • Bug fix
  • Improvement
  • New feature
  • Adding new one click service
  • Fixing or updating existing one click service

Preview

Application general settings — Databases section:

Application config showing database services with Backups links

Scheduled Backups page for a compose-app database:

Scheduled Backups page for a compose application database service

Demo walkthrough

AI Assistance

  • AI was NOT used to create this PR
  • AI was used (please describe below)

If AI was used:

  • Tools used: Claude Code (architecture review), Cursor (implementation)
  • How extensively: AI assisted with planning and code review. Implementation follows existing Coolify patterns for ServiceDatabase and DatabaseBackupJob and was manually verified.

Testing

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

  1. Parses a compose file with a PostgreSQL service — asserts ServiceDatabase row is created with the correct application_id
  2. Re-parses with the database service removed — asserts the stale row is cleaned up (orphan cleanup)

Race guard tested by mocking isDeploymentInprogress() returning true and asserting the job calls release(300) instead of running.

Contributor Agreement

[!IMPORTANT]

  • I have read and understood the contributor guidelines. If I have failed to follow any guideline, I understand that this PR may be closed without review.
  • I have searched existing issues and pull requests (including closed ones) to ensure this isn’t a duplicate.
  • I have tested all the changes thoroughly with a local development instance of Coolify and I am confident that they will work as expected when a maintainer tests them.

/claim #7528

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