feat(service): unify database and storage backups on one page

List service database schedules with volume backups, add a database
picker when creating scheduled DB backups from the service page, and
cover the unified table and create flow in tests.
This commit is contained in:
Andras Bacsai committed 2026-08-08 00:12:56 +02:00
1 parent 12b14665b5
commit c0b75d04a6
8 files changed
+288 -51

No files matched your search

@@ -202,3 +202,38 @@ test('service database backup schedules use dedicated general retention and exec
->assertDontSee('Number of backups to keep')
->assertDontSee('Cleanup Failed Backups');
});
test('service storage backups page includes schedules from all compose databases', function () {
$secondDatabase = ServiceDatabase::create([
'service_id' => $this->ownService->id,
'name' => 'analytics-db',
'image' => 'postgres:16-alpine',
'custom_type' => 'postgresql',
]);
foreach ([$this->ownServiceDatabase, $secondDatabase] as $database) {
ScheduledDatabaseBackup::create([
'team_id' => $this->teamA->id,
'description' => $database->name.' backup',
'frequency' => 'daily',
'database_id' => $database->id,
'database_type' => $database->getMorphClass(),
]);
}
$this->get(route('project.service.volume-backups.index', [
'project_uuid' => $this->projectA->uuid,
'environment_uuid' => $this->environmentA->uuid,
'service_uuid' => $this->ownService->uuid,
]))
->assertOk()
->assertSee('>Database</span>', false)
->assertSee('own-db')
->assertSee('analytics-db')
->assertSee(route('project.service.database.backups', [
'project_uuid' => $this->projectA->uuid,
'environment_uuid' => $this->environmentA->uuid,
'service_uuid' => $this->ownService->uuid,
'stack_service_uuid' => $this->ownServiceDatabase->uuid,
]), false);
});