File tree Expand file tree Collapse file tree 5 files changed +12
-1
lines changed
Expand file tree Collapse file tree 5 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " kysely-migrate " : patch
3+ ---
4+
5+ Updated exit code for failed migrations
Original file line number Diff line number Diff line change 8989 if ( result ) outro ( result )
9090 process . exit ( 0 )
9191} catch ( error ) {
92- outro ( pc . red ( `Error: ${ ( error as Error ) . message } ` ) )
92+ outro ( pc . red ( ( error as Error ) . message ) )
9393 process . exit ( 1 )
9494}
Original file line number Diff line number Diff line change @@ -60,5 +60,7 @@ export async function down(options: DownOptions) {
6060 s . stop ( 'Ran migrations' , error ? 1 : 0 )
6161
6262 logResultSet ( resultSet )
63+
64+ if ( error ) throw new Error ( 'Failed running migrations.' )
6365 return getAppliedMigrationsCount ( results )
6466}
Original file line number Diff line number Diff line change @@ -77,5 +77,7 @@ export async function to(options: ToOptions) {
7777 s . stop ( 'Ran migrations' , error ? 1 : 0 )
7878
7979 logResultSet ( resultSet )
80+
81+ if ( error ) throw new Error ( 'Failed running migrations.' )
8082 return getAppliedMigrationsCount ( results )
8183}
Original file line number Diff line number Diff line change @@ -41,5 +41,7 @@ export async function up(options: UpOptions) {
4141 s . stop ( 'Ran migrations' , error ? 1 : 0 )
4242
4343 logResultSet ( resultSet )
44+
45+ if ( error ) throw new Error ( 'Failed running migrations.' )
4446 return getAppliedMigrationsCount ( results )
4547}
You can’t perform that action at this time.
0 commit comments