Skip to content

Commit 442d105

Browse files
authored
fix: migrations exit code (#7989)
Migration command were not returning proper error codes on failure. This caused issues with CI in particular. Fixes #7031 for 3.0
1 parent c45ee0d commit 442d105

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

packages/drizzle/src/migrate.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,6 @@ async function runMigrationFile(payload: Payload, migration: Migration, batch: n
100100
err,
101101
msg: parseError(err, `Error running migration ${migration.name}`),
102102
})
103+
process.exit(1)
103104
}
104105
}

packages/drizzle/src/migrateFresh.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ export async function migrateFresh(
7474
err,
7575
msg: parseError(err, `Error running migration ${migration.name}. Rolling back`),
7676
})
77+
process.exit(1)
7778
}
7879
}
7980
}

packages/drizzle/src/migrateRefresh.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export async function migrateRefresh(this: DrizzleAdapter) {
100100
err,
101101
msg: parseError(err, `Error running migration ${migration.name}. Rolling back.`),
102102
})
103+
process.exit(1)
103104
}
104105
}
105106
}

0 commit comments

Comments
 (0)