feat(backups): scheduled database backups via cron tick

- database_services gains backup_schedule + next_backup_at (goose migration,
  sqlc schema, new queries).
- PUT /databases/:id accepts backup_schedule — validated cron expression,
  empty string disables; invalid returns 400.
- Cron scheduler tick now also folds due databases into the existing
  snapshot pipeline (createBackupProcess).
- Databases page backups section gets a schedule row showing current expr
  and next run.
- resolveBackupConfig reports real next_backup/enabled instead of a fake
  last+24h estimate.
- Verified e2e: '* * * * *' produced three consecutive completed archives
  containing the seeded payload; invalid schedule rejected.

Authored By: TDvorak <[email protected]>
This commit is contained in:
Tomas Dvorak committed 2026-09-17 17:46:02 +02:00
1 parent aeb91b03e9
commit 08d92fb10f
13 files changed
+387 -99

No files matched your search

+9
View File
@@ -7059,6 +7059,13 @@ export interface components {
plan?: "hobby" | "starter" | "standard" | "business";
/** @description Provisioning region */
region?: string;
/** @description Cron expression for automatic backups, empty when unset */
backup_schedule?: string;
/**
* Format: date-time
* @description Next scheduled backup run
*/
next_backup_at?: string;
metrics?: components["schemas"]["DatabaseMetrics"];
backups?: components["schemas"]["DatabaseBackupConfig"];
settings?: components["schemas"]["DatabaseSettings"];
@@ -7097,6 +7104,8 @@ export interface components {
* @enum {string}
*/
plan?: "hobby" | "starter" | "standard" | "business";
/** @description Cron expression for automatic backups; empty string clears the schedule */
backup_schedule?: string | null;
};
DatabaseActionRequest: {
/**