Skip to content

Support backups for compose-managed application databases#9359

Closed
boofpackdev wants to merge 1 commit intocoollabsio:nextfrom
boofpackdev:boof/issue-7528-compose-db-backups
Closed

Support backups for compose-managed application databases#9359
boofpackdev wants to merge 1 commit intocoollabsio:nextfrom
boofpackdev:boof/issue-7528-compose-db-backups

Conversation

@boofpackdev
Copy link
Copy Markdown

STRAWBERRY

Changes

Compose-managed database services (e.g., postgres, mysql, mariadb, mongodb) declared inside an Application's docker-compose.yml now support scheduled backups.

  • Schema: Added application_id nullable FK to service_databases table, made service_id nullable, added composite index on (application_id, name).
  • Model: ServiceDatabase now has an application() relation and Application has a databases() relation. Added parent-resolution helpers (parentServer, parentDestination, parentNetworkName, currentContainerName, backupDirectoryName, etc.) so backup and proxy code works whether the DB belongs to a Service or Application.
  • Parser: Both applicationParser functions now detect database images in compose YAML and upsert a ServiceDatabase row with application_id set and service_id null.
  • Backup runtime: DatabaseBackupJob resolves server, container, and network from the parent helpers instead of assuming service-based paths. Status check bypassed for application-backed DBs since their container status is sourced from application container scanning.
  • Proxy: StartDatabaseProxy / StopDatabaseProxy handle application-backed compose DBs via the parent-resolution helpers.
  • UI: New ComposeDatabaseBackups Livewire component at route project.application.compose-database.backups. Application general page shows a "Manage Backups" button for compose-managed DBs that support backups.
  • Tests: ApplicationComposeDatabaseBackupParsingTest covers DB persistence on compose parse and server resolution for scheduled backups.

Issues

Category

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

Preview

Coming soon.

AI Assistance

  • AI was used

If AI was used:

  • Tools used: Claude Code (this session), droid exec
  • How extensively: Full implementation — all code changes, tests, and validation

Testing

  • New tests: 2/2 pass (ApplicationComposeDatabaseBackupParsingTest)
  • Existing related tests: ServiceDatabaseTeamTest 2/2, ModelFillableRegressionTest 42/42, ServiceParserImageUpdateTest 4/4 — all pass
  • Migration tested with --pretend on the dev database
  • Diff verified clean with git diff --check

Contributor Agreement

  • I have read and understood the contributor guidelines
  • I have searched existing issues and pull requests to ensure this is not a duplicate
  • I have tested all changes with a local development instance of Coolify

@github-actions
Copy link
Copy Markdown
Contributor

This PR did not pass quality checks so it will be closed. If you believe this is a mistake please let us know.

@github-actions github-actions bot closed this Mar 31, 2026
@boofpackdev
Copy link
Copy Markdown
Author

hey sorry my hermes agent went rogue on the quest to bring me 10 bucks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant