Skip to content

Commit

Permalink
[drizzle-kit]: ensure statement breakpoints are on new line
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mbtools authored Nov 12, 2024
1 parent 83daf2d commit 99512b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drizzle-kit/src/cli/commands/migrate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down

0 comments on commit 99512b1

Please sign in to comment.