diff --git a/functions/api/schema.js b/functions/api/schema.js index 9869383..764d593 100644 --- a/functions/api/schema.js +++ b/functions/api/schema.js @@ -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 }); }