/claim #7528
Description
Enables ServiceDatabase record creation for databases deployed via GitHub App (dockercompose buildpack). Previously, databases were detected but treated as application containers without backup functionality.
Problem
When deploying Docker Compose files via GitHub App, database images (PostgreSQL, MySQL, etc.) were:
- ✅ Detected by
isDatabaseImage()
- ❌ Not creating ServiceDatabase records
- ❌ No backup functionality available
- ❌ Treated as regular application containers
Solution
Added ServiceDatabase creation logic to the Application model parsing path in parseDockerComposeFile(), mirroring the existing Service model path implementation.
Changes Made
- ✅ Added database detection and ServiceDatabase creation to Application model path
- ✅ Supports manual service type migration (preserves user choices)
- ✅ Handles both new deployments and updates
- ✅ Updates database image when compose file changes
- ✅ Enables backup/restore functionality for GitHub App databases
Technical Details
- File Modified: bootstrap/helpers/shared.php (+176 insertions, -108 deletions)
- Location: Lines 2365-2436 (Application model parsing section)
- Consistency: Mirrors Service model path logic (lines 1356-1424)
- Feature Parity: Application deployments now have same database support as Service deployments
Database Types Supported
- PostgreSQL (including PostGIS, pgvector, Timescale)
- MySQL
- MariaDB
- MongoDB
- Any database detected by
isDatabaseImage() function
Testing
The implementation has been verified through code review:
- Logic matches Service model path implementation
- Handles migrated services correctly
- Creates ServiceDatabase for detected databases
- Creates ServiceApplication for non-databases
- Updates images when changed
Manual testing recommended:
- Deploy Docker Compose via GitHub App with database service
- Verify ServiceDatabase record is created
- Check backup functionality is available
- Test backup creation and scheduling
Works With
- Pairs with #7529 (ServiceDatabase restore functionality)
- Together enables complete backup/restore workflow for all database deployments
Related Issue
Fixes #7528
Impact
- Enables backup functionality for GitHub App database deployments
- Brings Application model deployments to feature parity with Service model
- No breaking changes to existing deployments
- Respects user migration choices