From 99512b1fdfbf7e5525c9f32c513596d99d4350b5 Mon Sep 17 00:00:00 2001 From: Marc Bernard <59966492+mbtools@users.noreply.github.com> Date: Tue, 12 Nov 2024 17:41:45 -0500 Subject: [PATCH] [drizzle-kit]: ensure statement breakpoints are on new line Depending on how `BREAKPOINT` is used in the generate SQL, the text might appear at the end of the line. This fix ensures that the text is always on a new line. --- drizzle-kit/src/cli/commands/migrate.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drizzle-kit/src/cli/commands/migrate.ts b/drizzle-kit/src/cli/commands/migrate.ts index 0933af1941..65145e86c8 100644 --- a/drizzle-kit/src/cli/commands/migrate.ts +++ b/drizzle-kit/src/cli/commands/migrate.ts @@ -1068,8 +1068,8 @@ export const writeResult = ({ JSON.stringify(toSave, null, 2), ); - const sqlDelimiter = breakpoints ? BREAKPOINT : '\n'; - let sql = sqlStatements.join(sqlDelimiter); + const sqlDelimiter = breakpoints ? '\n' + BREAKPOINT : '\n'; + let sql = sqlStatements.join(sqlDelimiter).replace(/\n\n/g, '\n'); if (type === 'introspect') { sql =