From efd62ff3a7a64bc34a038f5e4e20a69bf84cf38e Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Thu, 2 Oct 2025 09:59:27 -0700 Subject: [PATCH] Fix: Use db.exec for schema creation as batch is unsupported --- functions/api/schema.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 }); }