mirror of
https://github.com/biersoeckli/QuickStack.git
synced 2026-04-29 13:59:15 -05:00
feat: implement separate backup jobs for databases with MongoDB support
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
-- RedefineTables
|
||||
PRAGMA defer_foreign_keys=ON;
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_VolumeBackup" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"volumeId" TEXT NOT NULL,
|
||||
"targetId" TEXT NOT NULL,
|
||||
"cron" TEXT NOT NULL,
|
||||
"retention" INTEGER NOT NULL,
|
||||
"useDatabaseBackup" BOOLEAN NOT NULL DEFAULT false,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updatedAt" DATETIME NOT NULL,
|
||||
CONSTRAINT "VolumeBackup_volumeId_fkey" FOREIGN KEY ("volumeId") REFERENCES "AppVolume" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
|
||||
CONSTRAINT "VolumeBackup_targetId_fkey" FOREIGN KEY ("targetId") REFERENCES "S3Target" ("id") ON DELETE CASCADE ON UPDATE CASCADE
|
||||
);
|
||||
INSERT INTO "new_VolumeBackup" ("createdAt", "cron", "id", "retention", "targetId", "updatedAt", "volumeId") SELECT "createdAt", "cron", "id", "retention", "targetId", "updatedAt", "volumeId" FROM "VolumeBackup";
|
||||
DROP TABLE "VolumeBackup";
|
||||
ALTER TABLE "new_VolumeBackup" RENAME TO "VolumeBackup";
|
||||
PRAGMA foreign_keys=ON;
|
||||
PRAGMA defer_foreign_keys=OFF;
|
||||
@@ -287,13 +287,14 @@ model S3Target {
|
||||
}
|
||||
|
||||
model VolumeBackup {
|
||||
id String @id @default(uuid())
|
||||
volumeId String
|
||||
volume AppVolume @relation(fields: [volumeId], references: [id], onDelete: Cascade)
|
||||
targetId String
|
||||
target S3Target @relation(fields: [targetId], references: [id], onDelete: Cascade)
|
||||
cron String
|
||||
retention Int
|
||||
id String @id @default(uuid())
|
||||
volumeId String
|
||||
volume AppVolume @relation(fields: [volumeId], references: [id], onDelete: Cascade)
|
||||
targetId String
|
||||
target S3Target @relation(fields: [targetId], references: [id], onDelete: Cascade)
|
||||
cron String
|
||||
retention Int
|
||||
useDatabaseBackup Boolean @default(false) // decides wether backup whole volume or make a dump of the databse (only for database volumes)
|
||||
|
||||
createdAt DateTime @default(now())
|
||||
updatedAt DateTime @updatedAt
|
||||
|
||||
Reference in New Issue
Block a user