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 <noreply@anthropic.com>
This commit is contained in:
1 parent
3ef353de83
commit
e5d0654d2a
1 file changed
+4
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user