From f5df68286c4e49d0b6cfd1aaf3e6bcc337652b34 Mon Sep 17 00:00:00 2001 From: Hana Worku Date: Tue, 19 Dec 2023 17:11:10 -0600 Subject: [PATCH] Exit 1 when prisma migrations fail --- dev_tool/src/local/postgres.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dev_tool/src/local/postgres.ts b/dev_tool/src/local/postgres.ts index 52241d57cb..80fc09879a 100644 --- a/dev_tool/src/local/postgres.ts +++ b/dev_tool/src/local/postgres.ts @@ -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() + } }