mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
Implement metadata handling for database and compose backups. Update backup schemas to include metadata fields for various database types. Enhance backup creation and update processes to accommodate new metadata requirements. Modify UI components to support metadata input for different database types during backup operations.
This commit is contained in:
@@ -3,6 +3,7 @@ import {
|
||||
type AnyPgColumn,
|
||||
boolean,
|
||||
integer,
|
||||
jsonb,
|
||||
pgEnum,
|
||||
pgTable,
|
||||
text,
|
||||
@@ -69,6 +70,23 @@ export const backups = pgTable("backup", {
|
||||
onDelete: "cascade",
|
||||
}),
|
||||
userId: text("userId").references(() => users_temp.id),
|
||||
// Only for compose backups
|
||||
metadata: jsonb("metadata").$type<{
|
||||
postgres?: {
|
||||
databaseUser: string;
|
||||
};
|
||||
mariadb?: {
|
||||
databaseUser: string;
|
||||
databasePassword: string;
|
||||
};
|
||||
mongo?: {
|
||||
databaseUser: string;
|
||||
databasePassword: string;
|
||||
};
|
||||
mysql?: {
|
||||
databaseRootPassword: string;
|
||||
};
|
||||
}>(),
|
||||
});
|
||||
|
||||
export const backupsRelations = relations(backups, ({ one }) => ({
|
||||
@@ -134,6 +152,7 @@ export const apiCreateBackup = createSchema.pick({
|
||||
backupType: true,
|
||||
composeId: true,
|
||||
serviceName: true,
|
||||
metadata: true,
|
||||
});
|
||||
|
||||
export const apiFindOneBackup = createSchema
|
||||
@@ -158,5 +177,6 @@ export const apiUpdateBackup = createSchema
|
||||
database: true,
|
||||
keepLatestCount: true,
|
||||
serviceName: true,
|
||||
metadata: true,
|
||||
})
|
||||
.required();
|
||||
|
||||
Reference in New Issue
Block a user