mirror of
https://github.com/spchcap/speech.capital.git
synced 2026-01-14 00:28:06 +00:00
Fix: Use db.exec for schema creation as batch is unsupported
This commit is contained in:
@@ -61,8 +61,7 @@ export async function onRequestPost({ request, env }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (action === 'create') {
|
if (action === 'create') {
|
||||||
const stmts = schemaV1.map(sql => db.prepare(sql));
|
const results = await db.exec(schemaV1.join(''));
|
||||||
const results = await db.batch(stmts);
|
|
||||||
return Response.json({ success: true, results });
|
return Response.json({ success: true, results });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user