Summary

Fixes #7528 — database services in Docker Compose files deployed via GitHub App (dockercompose buildpack) now get ServiceDatabase records created, enabling scheduled backup support.

/claim #7528

Root Cause

parseDockerComposeFile() branches on Service vs Application resource type. The Service path created ServiceDatabase records for detected database images. The Application path called isDatabaseImage() but never created those records, so backup support was silently missing for all GitHub-App-deployed compose databases.

Changes (10 files, +496 lines)

1. Migration

  • Adds nullable application_id column + index to service_databases
  • Makes service_id nullable — a ServiceDatabase can now belong to either a Service or an Application

2. ServiceDatabase model

  • application() — new belongsTo(Application::class) relationship
  • getParentResource() — returns the owning Service or Application
  • getServer() — resolves server via either parent path
  • ownedByCurrentTeam/API() — updated to include Application-owned databases via orWhereRelation
  • restart() — updated to handle both parent types

3. Application model

  • serviceDatabases() — new hasMany(ServiceDatabase::class) relationship

4. Parser (bootstrap/helpers/shared.php)

  • Application branch of parseDockerComposeFile() now creates/upserts ServiceDatabase records for detected DB images (skipped for PR previews)
  • Prunes orphaned ServiceDatabase records when services are removed from the compose file

5. DatabaseBackupJob

  • Server resolution uses $this->database->getServer() (works for both Service and Application parents)
  • Container/directory names derived from getParentResource()->uuid
  • S3 network resolution handles Application-owned databases via $parent->destination->network

6. New Backups UI for Application compose databases

  • app/Livewire/Project/Application/DatabaseBackups.php — Livewire component
  • resources/views/livewire/project/application/database-backups.blade.php — blade view
  • Route project.application.compose.database.backups at /{application_uuid}/{stack_service_uuid}/backups
  • Application configuration sidebar shows database Backups links for dockercompose builds

7. Tests (tests/Feature/ApplicationComposeDatabaseBackupsTest.php)

  • Migration column/index verification
  • Model relationship definitions
  • getServer() and getParentResource() for Application-owned databases
  • isBackupSolutionAvailable() for various image types
  • serviceDatabases() scoping between multiple applications

Claim

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

Contributors

JU

junyuc25

@junyuc25

100%

Sponsors

IL

Ilias Ism

@me

$100