File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change 1
1
import PgMigrate from 'node-pg-migrate' ;
2
- import { MigrationDirection } from 'node-pg-migrate/dist/types' ;
2
+ import { Logger as PgMigrateLogger , MigrationDirection } from 'node-pg-migrate/dist/types' ;
3
3
import { logger } from '../logger' ;
4
4
import { PgConnectionArgs , connectPostgres , standardizedConnectionArgs } from './connection' ;
5
5
import { isDevEnv , isTestEnv } from '../helpers/values' ;
@@ -11,6 +11,8 @@ export interface MigrationOptions {
11
11
logMigrations ?: boolean ;
12
12
/** Name of the table used for migrations. Defaults to `pgmigrations`. */
13
13
migrationsTable ?: string ;
14
+ /** Custom logging configuration */
15
+ logger ?: PgMigrateLogger ;
14
16
}
15
17
16
18
/**
@@ -50,7 +52,7 @@ export async function runMigrations(
50
52
} ,
51
53
migrationsTable : opts ?. migrationsTable ?? 'pgmigrations' ,
52
54
schema : typeof args === 'string' ? 'public' : args . schema ,
53
- logger : {
55
+ logger : opts ?. logger ?? {
54
56
info : msg => ( opts ?. logMigrations === true ? logger . info ( msg ) : { } ) ,
55
57
warn : msg => logger . warn ( msg ) ,
56
58
error : msg => logger . error ( msg ) ,
You can’t perform that action at this time.
0 commit comments