|
@@ -87,6 +87,15 @@ const updateDbStructure = async (db) => {
|
87
|
87
|
});
|
88
|
88
|
}
|
89
|
89
|
|
|
90
|
+ // 检查book表是否有draft_url字段
|
|
91
|
+ const hasDraftUrlColumn = await db.schema.hasColumn('book', 'draft_url');
|
|
92
|
+ if (!hasDraftUrlColumn) {
|
|
93
|
+ console.log('添加draft_url字段到book表');
|
|
94
|
+ await db.schema.table('book', table => {
|
|
95
|
+ table.string('draft_url').nullable();
|
|
96
|
+ });
|
|
97
|
+ }
|
|
98
|
+
|
90
|
99
|
// 检查book_info表是否有image_path字段
|
91
|
100
|
const hasImagePathColumn = await db.schema.hasColumn('book_info', 'image_path');
|
92
|
101
|
if (!hasImagePathColumn) {
|
|
@@ -160,6 +169,9 @@ const initDatabase = async (forceUpdate = false) => {
|
160
|
169
|
table.string('audio_path').nullable();
|
161
|
170
|
table.string('lip_sync_video_path').nullable();
|
162
|
171
|
table.string('lip_sync_task_id').nullable();
|
|
172
|
+ table.string('audio_url').nullable();
|
|
173
|
+ table.string('video_url').nullable();
|
|
174
|
+ table.string('draft_url').nullable();
|
163
|
175
|
table.timestamp('created_at').defaultTo(db.fn.now());
|
164
|
176
|
table.timestamp('updated_at').defaultTo(db.fn.now());
|
165
|
177
|
});
|