diff --git a/src/lib/initDB.ts b/src/lib/initDB.ts index 0779e17..7540d01 100644 --- a/src/lib/initDB.ts +++ b/src/lib/initDB.ts @@ -308,17 +308,17 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => builder: (table) => { table.integer("id").notNullable(); table.integer("scriptId"); - table.text("name"); + table.text("title"); table.text("prompt"); + table.text("description"); table.text("filePath"); table.text("model"); table.text("mode"); table.text("duration"); table.text("resolution"); - table.text("frameType"); + table.text("frameMode"); table.text("camera"); table.text("sound"); - table.text("associateAssetsIds"); table.integer("createTime"); table.primary(["id"]); table.unique(["id"]); @@ -431,11 +431,20 @@ export default async (knex: Knex, forceInit: boolean = false): Promise => builder: (table) => { table.integer("id").notNullable(); table.text("flowData").notNullable(); - table.integer("stroryboardId").notNullable(); + table.integer("storyboardId").notNullable(); table.primary(["id"]); table.unique(["id"]); }, }, + { + name: "o_assets2Storyboard", + builder: (table) => { + table.integer("storyboardId").notNullable(); + table.integer("assetId").notNullable(); + table.primary(["assetId", "assetId"]); + table.unique(["storyboardId", "assetId"]); + }, + }, ]; for (const t of tables) { diff --git a/src/routes/production/editStoryboard/getStoryboardFlow.ts b/src/routes/production/editStoryboard/getStoryboardFlow.ts index 19447db..97da636 100644 --- a/src/routes/production/editStoryboard/getStoryboardFlow.ts +++ b/src/routes/production/editStoryboard/getStoryboardFlow.ts @@ -12,7 +12,7 @@ export default router.post( }), async (req, res) => { const { id } = req.body; - const storyboardFlowData = await u.db("o_storyboardFlow").where("stroryboardId", id).first(); + const storyboardFlowData = await u.db("o_storyboardFlow").where("storyboardId", id).first(); if (storyboardFlowData?.flowData) { const parseFlow = JSON.parse(storyboardFlowData.flowData); await Promise.all( diff --git a/src/routes/production/editStoryboard/saveStoryboardFlow.ts b/src/routes/production/editStoryboard/saveStoryboardFlow.ts index e16281b..3dbcf9c 100644 --- a/src/routes/production/editStoryboard/saveStoryboardFlow.ts +++ b/src/routes/production/editStoryboard/saveStoryboardFlow.ts @@ -30,7 +30,7 @@ export default router.post( createTime: Date.now(), }); await u.db("o_storyboardFlow").insert({ - stroryboardId: id, + storyboardId: id, flowData: JSON.stringify({ edges, nodes }), }); return res.status(200).send(success()); diff --git a/src/routes/production/editStoryboard/updateStoryboardFlow.ts b/src/routes/production/editStoryboard/updateStoryboardFlow.ts index 626b377..d90fd6b 100644 --- a/src/routes/production/editStoryboard/updateStoryboardFlow.ts +++ b/src/routes/production/editStoryboard/updateStoryboardFlow.ts @@ -32,7 +32,7 @@ export default router.post( .update({ filePath: new URL(imageUrl).pathname }); await u .db("o_storyboardFlow") - .where("stroryboardId", id) + .where("storyboardId", id) .update({ flowData: JSON.stringify({ edges, nodes }), });