# Conflicts:
#	src/types/database.d.ts
This commit is contained in:
ACT丶流星雨 2026-03-23 14:24:40 +08:00
commit 187b284c85
4 changed files with 16 additions and 7 deletions

View File

@ -308,17 +308,17 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
builder: (table) => { builder: (table) => {
table.integer("id").notNullable(); table.integer("id").notNullable();
table.integer("scriptId"); table.integer("scriptId");
table.text("name"); table.text("title");
table.text("prompt"); table.text("prompt");
table.text("description");
table.text("filePath"); table.text("filePath");
table.text("model"); table.text("model");
table.text("mode"); table.text("mode");
table.text("duration"); table.text("duration");
table.text("resolution"); table.text("resolution");
table.text("frameType"); table.text("frameMode");
table.text("camera"); table.text("camera");
table.text("sound"); table.text("sound");
table.text("associateAssetsIds");
table.integer("createTime"); table.integer("createTime");
table.primary(["id"]); table.primary(["id"]);
table.unique(["id"]); table.unique(["id"]);
@ -431,11 +431,20 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
builder: (table) => { builder: (table) => {
table.integer("id").notNullable(); table.integer("id").notNullable();
table.text("flowData").notNullable(); table.text("flowData").notNullable();
table.integer("stroryboardId").notNullable(); table.integer("storyboardId").notNullable();
table.primary(["id"]); table.primary(["id"]);
table.unique(["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) { for (const t of tables) {

View File

@ -12,7 +12,7 @@ export default router.post(
}), }),
async (req, res) => { async (req, res) => {
const { id } = req.body; 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) { if (storyboardFlowData?.flowData) {
const parseFlow = JSON.parse(storyboardFlowData.flowData); const parseFlow = JSON.parse(storyboardFlowData.flowData);
await Promise.all( await Promise.all(

View File

@ -30,7 +30,7 @@ export default router.post(
createTime: Date.now(), createTime: Date.now(),
}); });
await u.db("o_storyboardFlow").insert({ await u.db("o_storyboardFlow").insert({
stroryboardId: id, storyboardId: id,
flowData: JSON.stringify({ edges, nodes }), flowData: JSON.stringify({ edges, nodes }),
}); });
return res.status(200).send(success()); return res.status(200).send(success());

View File

@ -32,7 +32,7 @@ export default router.post(
.update({ filePath: new URL(imageUrl).pathname }); .update({ filePath: new URL(imageUrl).pathname });
await u await u
.db("o_storyboardFlow") .db("o_storyboardFlow")
.where("stroryboardId", id) .where("storyboardId", id)
.update({ .update({
flowData: JSON.stringify({ edges, nodes }), flowData: JSON.stringify({ edges, nodes }),
}); });