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:
parent
6ff06576d0
commit
54a3c6efff
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,
|
||||
"tag": "0069_legal_bill_hollister",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 70,
|
||||
"version": "7",
|
||||
"when": 1741176766694,
|
||||
"tag": "0070_rapid_quasar",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user