feat(plugin): update deployment flow

This commit is contained in:
BennyKok
2024-01-05 19:27:31 +08:00
parent d6707295cc
commit 157b126fbf
6 changed files with 930 additions and 74 deletions
+13 -1
View File
@@ -69,6 +69,7 @@ export const workflowVersionTable = dbSchema.table("workflow_versions", {
workflow: jsonb("workflow").$type<z.infer<typeof workflowType>>(),
workflow_api: jsonb("workflow_api").$type<z.infer<typeof workflowAPIType>>(),
version: integer("version").notNull(),
snapshot: jsonb("snapshot").$type<z.infer<typeof snapshotType>>(),
created_at: timestamp("created_at").defaultNow().notNull(),
updated_at: timestamp("updated_at").defaultNow().notNull(),
@@ -201,10 +202,21 @@ export const machinesTable = dbSchema.table("machines", {
auth_token: text("auth_token"),
type: machinesType("type").notNull().default("classic"),
status: machinesStatus("status").notNull().default("ready"),
snapshot: jsonb("snapshot").$type<any>(),
snapshot: jsonb("snapshot").$type<z.infer<typeof snapshotType>>(),
build_log: text("build_log"),
});
export const snapshotType = z.object({
comfyui: z.string(),
git_custom_nodes: z.record(
z.object({
hash: z.string(),
disabled: z.boolean(),
})
),
file_custom_nodes: z.array(z.any()),
});
export const insertMachineSchema = createInsertSchema(machinesTable, {
name: (schema) => schema.name.default("My Machine"),
endpoint: (schema) => schema.endpoint.default("http://127.0.0.1:8188"),