Skip to content

Commit

Permalink
Exit 1 when prisma migrations fail
Browse files Browse the repository at this point in the history
  • Loading branch information
haworku committed Dec 19, 2023
1 parent 9b1f2c9 commit f5df682
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dev_tool/src/local/postgres.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,14 @@ export async function runPostgresLocally(runner: LabeledProcessRunner) {

// reset the db, wiping it and running all the migrations files that exist
// does not db push schema changes into the database
await runner.runCommandAndOutput(
const migrateResponse = await runner.runCommandAndOutput(
'prisma reset',
['npx', 'lerna', 'run', 'prisma:reset'],
''
)

if (migrateResponse !== 0) {
console.error(`prisma:reset failed - check migrations file`)
process.exit()
}
}

0 comments on commit f5df682

Please sign in to comment.