From e5d0654d2af7a1a61a65402192b9fee7c02dd897 Mon Sep 17 00:00:00 2001 From: Ajay Ghanwat Date: Tue, 4 Aug 2026 21:26:10 +0530 Subject: [PATCH] docs: join the DDL statement lists in the Task 13 init command authzMigrationSql was changed in Task 11 to return statement arrays rather than one blob, but Task 13's init still interpolated them straight into the migration file, which would comma-join two CREATE TABLE statements into one unparseable line. Co-Authored-By: Claude Opus 5 --- docs/plans/2026-08-04-authz-permissions-implementation.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/plans/2026-08-04-authz-permissions-implementation.md b/docs/plans/2026-08-04-authz-permissions-implementation.md index 41d40608..1d4ce78b 100644 --- a/docs/plans/2026-08-04-authz-permissions-implementation.md +++ b/docs/plans/2026-08-04-authz-permissions-implementation.md @@ -3212,7 +3212,10 @@ export async function runAuthzCommand( mkdirSync(dir, { recursive: true }); const { up, down } = authzMigrationSql(dialect); const file = join(dir, `${nextMigrationNumber(dir)}_authz_tables.sql`); - writeFileSync(file, `-- +up\n${up}\n\n-- +down\n${down}\n`, "utf8"); + // up/down are statement LISTS; interpolating the arrays directly would + // comma-join them into one unparseable statement. + const block = (statements: string[]) => statements.map((s) => `${s};`).join("\n\n"); + writeFileSync(file, `-- +up\n${block(up)}\n\n-- +down\n${block(down)}\n`, "utf8"); console.log(`Wrote ${file}`); console.log("Run `wrnexus db migrate` to apply it."); return;