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:
@@ -2,6 +2,7 @@ import { relations } from "drizzle-orm";
|
||||
import {
|
||||
type AnyPgColumn,
|
||||
boolean,
|
||||
integer,
|
||||
pgEnum,
|
||||
pgTable,
|
||||
text,
|
||||
@@ -36,6 +37,8 @@ export const backups = pgTable("backup", {
|
||||
.notNull()
|
||||
.references(() => destinations.destinationId, { onDelete: "cascade" }),
|
||||
|
||||
keepLatestCount: integer("keepLatestCount"),
|
||||
|
||||
databaseType: databaseType("databaseType").notNull(),
|
||||
postgresId: text("postgresId").references(
|
||||
(): AnyPgColumn => postgres.postgresId,
|
||||
@@ -87,6 +90,7 @@ const createSchema = createInsertSchema(backups, {
|
||||
prefix: z.string().min(1),
|
||||
database: z.string().min(1),
|
||||
schedule: z.string(),
|
||||
keepLatestCount: z.number().optional(),
|
||||
databaseType: z.enum(["postgres", "mariadb", "mysql", "mongo"]),
|
||||
postgresId: z.string().optional(),
|
||||
mariadbId: z.string().optional(),
|
||||
@@ -99,6 +103,7 @@ export const apiCreateBackup = createSchema.pick({
|
||||
enabled: true,
|
||||
prefix: true,
|
||||
destinationId: true,
|
||||
keepLatestCount: true,
|
||||
database: true,
|
||||
mariadbId: true,
|
||||
mysqlId: true,
|
||||
@@ -127,5 +132,6 @@ export const apiUpdateBackup = createSchema
|
||||
backupId: true,
|
||||
destinationId: true,
|
||||
database: true,
|
||||
keepLatestCount: true,
|
||||
})
|
||||
.required();
|
||||
|
||||
Reference in New Issue
Block a user