Fix: Use db.exec for schema creation as batch is unsupported

This commit is contained in:
2025-10-02 09:59:27 -07:00
parent 467666cf67
commit efd62ff3a7

View File

@@ -61,8 +61,7 @@ export async function onRequestPost({ request, env }) {
}
if (action === 'create') {
const stmts = schemaV1.map(sql => db.prepare(sql));
const results = await db.batch(stmts);
const results = await db.exec(schemaV1.join(''));
return Response.json({ success: true, results });
}