修改数据库
This commit is contained in:
parent
8102779233
commit
8b8dbc224c
@ -437,8 +437,8 @@ export default async (knex: Knex, forceInit: boolean = false): Promise<void> =>
|
|||||||
builder: (table) => {
|
builder: (table) => {
|
||||||
table.integer("storyboardId").notNullable();
|
table.integer("storyboardId").notNullable();
|
||||||
table.integer("assetId").notNullable();
|
table.integer("assetId").notNullable();
|
||||||
table.primary(["id"]);
|
table.primary(["assetId", "assetId"]);
|
||||||
table.unique(["id"]);
|
table.unique(["storyboardId", "assetId"]);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@ -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(
|
||||||
|
|||||||
@ -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());
|
||||||
|
|||||||
@ -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 }),
|
||||||
});
|
});
|
||||||
|
|||||||
151
src/types/database.d.ts
vendored
151
src/types/database.d.ts
vendored
@ -1,6 +1,30 @@
|
|||||||
// @db-hash bea1bd617996a9e12ad951edcce03880
|
// @db-hash 307e7d70184bd3663540410a66e5c54d
|
||||||
//该文件由脚本自动生成,请勿手动修改
|
//该文件由脚本自动生成,请勿手动修改
|
||||||
|
|
||||||
|
export interface _o_storyboard_old_20260321 {
|
||||||
|
'createTime'?: number | null;
|
||||||
|
'detail'?: string | null;
|
||||||
|
'filePath'?: string | null;
|
||||||
|
'frameType'?: string | null;
|
||||||
|
'id'?: number;
|
||||||
|
'name'?: string | null;
|
||||||
|
'prompt'?: string | null;
|
||||||
|
'seconds'?: string | null;
|
||||||
|
}
|
||||||
|
export interface _o_storyboard_old_20260321_1 {
|
||||||
|
'associateAssetsIds'?: string | null;
|
||||||
|
'camera'?: string | null;
|
||||||
|
'createTime'?: number | null;
|
||||||
|
'detail'?: string | null;
|
||||||
|
'filePath'?: string | null;
|
||||||
|
'frameType'?: string | null;
|
||||||
|
'id'?: number;
|
||||||
|
'name'?: string | null;
|
||||||
|
'prompt'?: string | null;
|
||||||
|
'seconds'?: string | null;
|
||||||
|
'sound'?: string | null;
|
||||||
|
'TEXT'?: any | null;
|
||||||
|
}
|
||||||
export interface memories {
|
export interface memories {
|
||||||
'content': string;
|
'content': string;
|
||||||
'createTime': number;
|
'createTime': number;
|
||||||
@ -35,12 +59,22 @@ export interface o_assets {
|
|||||||
'projectId'?: number | null;
|
'projectId'?: number | null;
|
||||||
'prompt'?: string | null;
|
'prompt'?: string | null;
|
||||||
'remark'?: string | null;
|
'remark'?: string | null;
|
||||||
'scriptId'?: number | null;
|
|
||||||
'sonId'?: number | null;
|
'sonId'?: number | null;
|
||||||
'startTime'?: number | null;
|
'startTime'?: number | null;
|
||||||
'state'?: string | null;
|
'state'?: string | null;
|
||||||
'type'?: string | null;
|
'type'?: string | null;
|
||||||
}
|
}
|
||||||
|
export interface o_assets2Storyboard {
|
||||||
|
'assetId'?: number;
|
||||||
|
'storyboardId': number;
|
||||||
|
}
|
||||||
|
export interface o_chatHistory {
|
||||||
|
'data'?: string | null;
|
||||||
|
'id'?: number;
|
||||||
|
'novel'?: string | null;
|
||||||
|
'projectId'?: number | null;
|
||||||
|
'type'?: string | null;
|
||||||
|
}
|
||||||
export interface o_event {
|
export interface o_event {
|
||||||
'createTime'?: number | null;
|
'createTime'?: number | null;
|
||||||
'detail'?: string | null;
|
'detail'?: string | null;
|
||||||
@ -61,10 +95,33 @@ export interface o_image {
|
|||||||
'assetsId'?: number | null;
|
'assetsId'?: number | null;
|
||||||
'filePath'?: string | null;
|
'filePath'?: string | null;
|
||||||
'id'?: number;
|
'id'?: number;
|
||||||
'model'?: string | null;
|
'projectId'?: number | null;
|
||||||
'resolution'?: string | null;
|
'scriptId'?: number | null;
|
||||||
'state'?: string | null;
|
'state'?: string | null;
|
||||||
'type'?: string | null;
|
'type'?: string | null;
|
||||||
|
'videoId'?: number | null;
|
||||||
|
}
|
||||||
|
export interface o_model {
|
||||||
|
'apiKey'?: string | null;
|
||||||
|
'baseUrl'?: string | null;
|
||||||
|
'createTime'?: number | null;
|
||||||
|
'id'?: number;
|
||||||
|
'index'?: number | null;
|
||||||
|
'manufacturer'?: string | null;
|
||||||
|
'model'?: string | null;
|
||||||
|
'modelType'?: string | null;
|
||||||
|
'type'?: string | null;
|
||||||
|
}
|
||||||
|
export interface o_myTasks {
|
||||||
|
'describe'?: string | null;
|
||||||
|
'id'?: number;
|
||||||
|
'model'?: string | null;
|
||||||
|
'projectId'?: number | null;
|
||||||
|
'reason'?: string | null;
|
||||||
|
'relatedObjects'?: string | null;
|
||||||
|
'startTime'?: number | null;
|
||||||
|
'state'?: string | null;
|
||||||
|
'taskClass'?: string | null;
|
||||||
}
|
}
|
||||||
export interface o_novel {
|
export interface o_novel {
|
||||||
'chapter'?: string | null;
|
'chapter'?: string | null;
|
||||||
@ -97,6 +154,15 @@ export interface o_project {
|
|||||||
'userId'?: number | null;
|
'userId'?: number | null;
|
||||||
'videoRatio'?: string | null;
|
'videoRatio'?: string | null;
|
||||||
}
|
}
|
||||||
|
export interface o_prompts {
|
||||||
|
'code'?: string | null;
|
||||||
|
'customValue'?: string | null;
|
||||||
|
'defaultValue'?: string | null;
|
||||||
|
'id'?: number;
|
||||||
|
'name'?: string | null;
|
||||||
|
'parentCode'?: string | null;
|
||||||
|
'type'?: string | null;
|
||||||
|
}
|
||||||
export interface o_script {
|
export interface o_script {
|
||||||
'content'?: string | null;
|
'content'?: string | null;
|
||||||
'createTime'?: number | null;
|
'createTime'?: number | null;
|
||||||
@ -104,30 +170,47 @@ export interface o_script {
|
|||||||
'name'?: string | null;
|
'name'?: string | null;
|
||||||
'projectId'?: number | null;
|
'projectId'?: number | null;
|
||||||
}
|
}
|
||||||
|
export interface o_scriptAssets {
|
||||||
|
'assetsId'?: number | null;
|
||||||
|
'id'?: number;
|
||||||
|
'scriptId'?: number | null;
|
||||||
|
}
|
||||||
|
export interface o_scriptOutline {
|
||||||
|
'id'?: number;
|
||||||
|
'outlineId'?: number | null;
|
||||||
|
'scriptId'?: number | null;
|
||||||
|
}
|
||||||
export interface o_setting {
|
export interface o_setting {
|
||||||
'key'?: string | null;
|
'key'?: string | null;
|
||||||
'value'?: string | null;
|
'value'?: string | null;
|
||||||
}
|
}
|
||||||
|
export interface o_skills {
|
||||||
|
'id'?: number;
|
||||||
|
'name'?: string | null;
|
||||||
|
'startTime'?: number | null;
|
||||||
|
}
|
||||||
export interface o_storyboard {
|
export interface o_storyboard {
|
||||||
'associateAssetsIds'?: string | null;
|
'associateAssetsIds'?: string | null;
|
||||||
'camera'?: string | null;
|
'camera'?: string | null;
|
||||||
'createTime'?: number | null;
|
'createTime'?: number | null;
|
||||||
'duration'?: string | null;
|
'detail'?: string | null;
|
||||||
'filePath'?: string | null;
|
'filePath'?: string | null;
|
||||||
'frameType'?: string | null;
|
'frameType'?: string | null;
|
||||||
'id'?: number;
|
'id'?: number;
|
||||||
'mode'?: string | null;
|
|
||||||
'model'?: string | null;
|
|
||||||
'name'?: string | null;
|
'name'?: string | null;
|
||||||
'prompt'?: string | null;
|
'prompt'?: string | null;
|
||||||
'resolution'?: string | null;
|
'seconds'?: string | null;
|
||||||
'scriptId'?: number | null;
|
|
||||||
'sound'?: string | null;
|
'sound'?: string | null;
|
||||||
}
|
}
|
||||||
export interface o_storyboardFlow {
|
export interface o_storyboardFlow {
|
||||||
'flowData': string;
|
'flowData': string;
|
||||||
'id'?: number;
|
'id'?: number;
|
||||||
'stroryboardId': number;
|
'storyboardId': number;
|
||||||
|
}
|
||||||
|
export interface o_storyboardScript {
|
||||||
|
'id'?: number;
|
||||||
|
'scriptId'?: number | null;
|
||||||
|
'storyboardId'?: number | null;
|
||||||
}
|
}
|
||||||
export interface o_tasks {
|
export interface o_tasks {
|
||||||
'describe'?: string | null;
|
'describe'?: string | null;
|
||||||
@ -157,46 +240,66 @@ export interface o_vendorConfig {
|
|||||||
'version'?: string | null;
|
'version'?: string | null;
|
||||||
}
|
}
|
||||||
export interface o_video {
|
export interface o_video {
|
||||||
|
'configId'?: number | null;
|
||||||
'errorReason'?: string | null;
|
'errorReason'?: string | null;
|
||||||
'filePath'?: string | null;
|
'filePath'?: string | null;
|
||||||
|
'firstFrame'?: string | null;
|
||||||
'id'?: number;
|
'id'?: number;
|
||||||
'scriptId'?: number | null;
|
|
||||||
'state'?: string | null;
|
|
||||||
'storyboardId'?: number | null;
|
|
||||||
'time'?: number | null;
|
|
||||||
}
|
|
||||||
export interface o_videoConfig {
|
|
||||||
'audio'?: number | null;
|
|
||||||
'createTime'?: number | null;
|
|
||||||
'data'?: string | null;
|
|
||||||
'duration'?: number | null;
|
|
||||||
'id'?: number;
|
|
||||||
'mode'?: string | null;
|
|
||||||
'model'?: string | null;
|
'model'?: string | null;
|
||||||
'prompt'?: string | null;
|
'prompt'?: string | null;
|
||||||
'resolution'?: string | null;
|
'resolution'?: string | null;
|
||||||
'storyboardId'?: number | null;
|
'scriptId'?: number | null;
|
||||||
|
'state'?: number | null;
|
||||||
|
'storyboardImgs'?: string | null;
|
||||||
|
'time'?: number | null;
|
||||||
|
}
|
||||||
|
export interface o_videoConfig {
|
||||||
|
'aiConfigId'?: number | null;
|
||||||
|
'audioEnabled'?: number | null;
|
||||||
|
'createTime'?: number | null;
|
||||||
|
'duration'?: number | null;
|
||||||
|
'endFrame'?: string | null;
|
||||||
|
'id'?: number;
|
||||||
|
'images'?: string | null;
|
||||||
|
'manufacturer'?: string | null;
|
||||||
|
'mode'?: string | null;
|
||||||
|
'projectId'?: number | null;
|
||||||
|
'prompt'?: string | null;
|
||||||
|
'resolution'?: string | null;
|
||||||
|
'scriptId'?: number | null;
|
||||||
|
'selectedResultId'?: number | null;
|
||||||
|
'startFrame'?: string | null;
|
||||||
'updateTime'?: number | null;
|
'updateTime'?: number | null;
|
||||||
'videoId'?: number | null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DB {
|
export interface DB {
|
||||||
|
"_o_storyboard_old_20260321": _o_storyboard_old_20260321;
|
||||||
|
"_o_storyboard_old_20260321_1": _o_storyboard_old_20260321_1;
|
||||||
"memories": memories;
|
"memories": memories;
|
||||||
"o_agentDeploy": o_agentDeploy;
|
"o_agentDeploy": o_agentDeploy;
|
||||||
"o_artStyle": o_artStyle;
|
"o_artStyle": o_artStyle;
|
||||||
"o_assets": o_assets;
|
"o_assets": o_assets;
|
||||||
|
"o_assets2Storyboard": o_assets2Storyboard;
|
||||||
|
"o_chatHistory": o_chatHistory;
|
||||||
"o_event": o_event;
|
"o_event": o_event;
|
||||||
"o_eventChapter": o_eventChapter;
|
"o_eventChapter": o_eventChapter;
|
||||||
"o_flowData": o_flowData;
|
"o_flowData": o_flowData;
|
||||||
"o_image": o_image;
|
"o_image": o_image;
|
||||||
|
"o_model": o_model;
|
||||||
|
"o_myTasks": o_myTasks;
|
||||||
"o_novel": o_novel;
|
"o_novel": o_novel;
|
||||||
"o_outline": o_outline;
|
"o_outline": o_outline;
|
||||||
"o_outlineNovel": o_outlineNovel;
|
"o_outlineNovel": o_outlineNovel;
|
||||||
"o_project": o_project;
|
"o_project": o_project;
|
||||||
|
"o_prompts": o_prompts;
|
||||||
"o_script": o_script;
|
"o_script": o_script;
|
||||||
|
"o_scriptAssets": o_scriptAssets;
|
||||||
|
"o_scriptOutline": o_scriptOutline;
|
||||||
"o_setting": o_setting;
|
"o_setting": o_setting;
|
||||||
|
"o_skills": o_skills;
|
||||||
"o_storyboard": o_storyboard;
|
"o_storyboard": o_storyboard;
|
||||||
"o_storyboardFlow": o_storyboardFlow;
|
"o_storyboardFlow": o_storyboardFlow;
|
||||||
|
"o_storyboardScript": o_storyboardScript;
|
||||||
"o_tasks": o_tasks;
|
"o_tasks": o_tasks;
|
||||||
"o_user": o_user;
|
"o_user": o_user;
|
||||||
"o_vendorConfig": o_vendorConfig;
|
"o_vendorConfig": o_vendorConfig;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user