From fbe08f82ee4c8864b5ba568a5e6ee4a42dec0a00 Mon Sep 17 00:00:00 2001 From: Bruce McLachlan Date: Thu, 10 Sep 2026 17:47:56 +0200 Subject: [PATCH] fix(backups): back up the mailbox_aliases table Migration 0023 created mailbox_aliases without adding it to BACKUP_TABLES, so assertBackupTablesCoverDatabase aborts every manual and scheduled backup once that migration has run. Co-Authored-By: Claude Opus 5 (1M context) --- src/lib/backups/export.ts | 2 +- src/lib/backups/types.d.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/backups/export.ts b/src/lib/backups/export.ts index e97ebff..b96decc 100644 --- a/src/lib/backups/export.ts +++ b/src/lib/backups/export.ts @@ -1,7 +1,7 @@ import type { DatabaseBackupDocument, DatabaseBackupTable, DatabaseRecord } from "./types"; import { mergeLegacyMessageBodies } from "./utils"; -const BACKUP_TABLES: DatabaseBackupTable[] = ["users", "domains", "mailboxes", "mailbox_access", "contacts", "folders", "api_keys", "messages", "message_attachments", "outbound_jobs", "routing_rules", "webhooks", "webhook_deliveries", "sessions", "audit_logs", "backup_settings", "backups", "app_settings", "license_settings", "email_templates", "calendar_events", "auto_reply_deliveries", "spam_token_stats", "spam_reputation", "spam_feedback"]; +const BACKUP_TABLES: DatabaseBackupTable[] = ["users", "domains", "mailboxes", "mailbox_access", "contacts", "folders", "api_keys", "messages", "message_attachments", "outbound_jobs", "routing_rules", "webhooks", "webhook_deliveries", "sessions", "audit_logs", "backup_settings", "backups", "app_settings", "license_settings", "email_templates", "calendar_events", "auto_reply_deliveries", "mailbox_aliases", "spam_token_stats", "spam_reputation", "spam_feedback"]; /** * Tables every backup document must contain. Tables added to BACKUP_TABLES * after the format shipped are absent from older documents, so they stay diff --git a/src/lib/backups/types.d.ts b/src/lib/backups/types.d.ts index ac6d5bf..73a48b8 100644 --- a/src/lib/backups/types.d.ts +++ b/src/lib/backups/types.d.ts @@ -1,5 +1,5 @@ export type BackupScheduleType = "daily" | "weekly" | "monthly"; -export type DatabaseBackupTable = "users" | "domains" | "mailboxes" | "mailbox_access" | "contacts" | "folders" | "api_keys" | "messages" | "message_attachments" | "outbound_jobs" | "routing_rules" | "webhooks" | "webhook_deliveries" | "sessions" | "audit_logs" | "backup_settings" | "backups" | "app_settings" | "license_settings" | "email_templates" | "calendar_events" | "auto_reply_deliveries" | "spam_token_stats" | "spam_reputation" | "spam_feedback"; +export type DatabaseBackupTable = "users" | "domains" | "mailboxes" | "mailbox_access" | "contacts" | "folders" | "api_keys" | "messages" | "message_attachments" | "outbound_jobs" | "routing_rules" | "webhooks" | "webhook_deliveries" | "sessions" | "audit_logs" | "backup_settings" | "backups" | "app_settings" | "license_settings" | "email_templates" | "calendar_events" | "auto_reply_deliveries" | "mailbox_aliases" | "spam_token_stats" | "spam_reputation" | "spam_feedback"; export type DatabaseRecord = Record; export type DatabaseBackupDocument = { format: "mailflare-database-backup"; version: 1; createdAt: string; tables: Record; };