mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat(database): add keepLatestCount column to backup table
This commit is contained in:
1
apps/dokploy/drizzle/0070_rapid_quasar.sql
Normal file
1
apps/dokploy/drizzle/0070_rapid_quasar.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
ALTER TABLE "backup" ADD COLUMN "keepLatestCount" integer;
|
||||||
5125
apps/dokploy/drizzle/meta/0070_snapshot.json
Normal file
5125
apps/dokploy/drizzle/meta/0070_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -491,6 +491,13 @@
|
|||||||
"when": 1741152916611,
|
"when": 1741152916611,
|
||||||
"tag": "0069_legal_bill_hollister",
|
"tag": "0069_legal_bill_hollister",
|
||||||
"breakpoints": true
|
"breakpoints": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"idx": 70,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1741176766694,
|
||||||
|
"tag": "0070_rapid_quasar",
|
||||||
|
"breakpoints": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -2,6 +2,7 @@ import { relations } from "drizzle-orm";
|
|||||||
import {
|
import {
|
||||||
type AnyPgColumn,
|
type AnyPgColumn,
|
||||||
boolean,
|
boolean,
|
||||||
|
integer,
|
||||||
pgEnum,
|
pgEnum,
|
||||||
pgTable,
|
pgTable,
|
||||||
text,
|
text,
|
||||||
@@ -36,6 +37,8 @@ export const backups = pgTable("backup", {
|
|||||||
.notNull()
|
.notNull()
|
||||||
.references(() => destinations.destinationId, { onDelete: "cascade" }),
|
.references(() => destinations.destinationId, { onDelete: "cascade" }),
|
||||||
|
|
||||||
|
keepLatestCount: integer("keepLatestCount"),
|
||||||
|
|
||||||
databaseType: databaseType("databaseType").notNull(),
|
databaseType: databaseType("databaseType").notNull(),
|
||||||
postgresId: text("postgresId").references(
|
postgresId: text("postgresId").references(
|
||||||
(): AnyPgColumn => postgres.postgresId,
|
(): AnyPgColumn => postgres.postgresId,
|
||||||
@@ -87,6 +90,7 @@ const createSchema = createInsertSchema(backups, {
|
|||||||
prefix: z.string().min(1),
|
prefix: z.string().min(1),
|
||||||
database: z.string().min(1),
|
database: z.string().min(1),
|
||||||
schedule: z.string(),
|
schedule: z.string(),
|
||||||
|
keepLatestCount: z.number().optional(),
|
||||||
databaseType: z.enum(["postgres", "mariadb", "mysql", "mongo"]),
|
databaseType: z.enum(["postgres", "mariadb", "mysql", "mongo"]),
|
||||||
postgresId: z.string().optional(),
|
postgresId: z.string().optional(),
|
||||||
mariadbId: z.string().optional(),
|
mariadbId: z.string().optional(),
|
||||||
@@ -99,6 +103,7 @@ export const apiCreateBackup = createSchema.pick({
|
|||||||
enabled: true,
|
enabled: true,
|
||||||
prefix: true,
|
prefix: true,
|
||||||
destinationId: true,
|
destinationId: true,
|
||||||
|
keepLatestCount: true,
|
||||||
database: true,
|
database: true,
|
||||||
mariadbId: true,
|
mariadbId: true,
|
||||||
mysqlId: true,
|
mysqlId: true,
|
||||||
@@ -127,5 +132,6 @@ export const apiUpdateBackup = createSchema
|
|||||||
backupId: true,
|
backupId: true,
|
||||||
destinationId: true,
|
destinationId: true,
|
||||||
database: true,
|
database: true,
|
||||||
|
keepLatestCount: true,
|
||||||
})
|
})
|
||||||
.required();
|
.required();
|
||||||
|
|||||||
Reference in New Issue
Block a user