feat: Git-based backup system replacing JSON bundle backup/restore
DB is source of truth with git as downstream replica. SSH key generated on first start, all resource mutations committed as apply-compatible YAML. Supports manual commit import, conflict resolution (DB wins), disaster recovery (empty DB restores from git), and timeline branches on restore. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
-- Backup pending queue for git-based backup sync
|
||||
CREATE TABLE "BackupPending" (
|
||||
"id" TEXT NOT NULL,
|
||||
"resourceKind" TEXT NOT NULL,
|
||||
"resourceName" TEXT NOT NULL,
|
||||
"action" TEXT NOT NULL,
|
||||
"userName" TEXT NOT NULL,
|
||||
"yamlContent" TEXT,
|
||||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "BackupPending_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
CREATE INDEX "BackupPending_createdAt_idx" ON "BackupPending"("createdAt");
|
||||
@@ -299,6 +299,20 @@ model AuditEvent {
|
||||
@@index([userName])
|
||||
}
|
||||
|
||||
// ── Backup Pending Queue ──
|
||||
|
||||
model BackupPending {
|
||||
id String @id @default(cuid())
|
||||
resourceKind String
|
||||
resourceName String
|
||||
action String // 'create' | 'update' | 'delete'
|
||||
userName String
|
||||
yamlContent String? @db.Text
|
||||
createdAt DateTime @default(now())
|
||||
|
||||
@@index([createdAt])
|
||||
}
|
||||
|
||||
// ── Audit Logs ──
|
||||
|
||||
model AuditLog {
|
||||
|
||||
Reference in New Issue
Block a user