File tree Expand file tree Collapse file tree 1 file changed +18
-17
lines changed
Expand file tree Collapse file tree 1 file changed +18
-17
lines changed Original file line number Diff line number Diff line change 1- import { drizzle } from " drizzle-orm/postgres-js" ;
2- import { migrate } from " drizzle-orm/postgres-js/migrator" ;
3- import postgres from " postgres" ;
4- import { envDBSchema } from " ./env-schema" ;
1+ import { drizzle } from ' drizzle-orm/postgres-js'
2+ import { migrate } from ' drizzle-orm/postgres-js/migrator'
3+ import postgres from ' postgres'
4+ import { envDBSchema } from ' ./env-schema'
55
66const migrationConnection = postgres ( envDBSchema . DATABASE_URL , {
7- max : 1 ,
8- ssl : envDBSchema . PG_CLIENT_SSL === "true" ? true : false ,
9- } ) ;
7+ max : 5 ,
8+ ssl : envDBSchema . PG_CLIENT_SSL === 'true' ? true : false ,
9+ connect_timeout : 120 ,
10+ } )
1011
1112async function main ( ) {
12- console . log ( " Migrations started..." ) ;
13- await migrate ( drizzle ( migrationConnection ) , {
14- migrationsFolder : " ./drizzle" ,
15- } ) ;
16- await migrationConnection . end ( ) ;
17- console . log ( " Migrations finished" ) ;
18- process . exit ( 0 ) ;
13+ console . log ( ' Migrations started...' )
14+ await migrate ( drizzle ( migrationConnection ) , {
15+ migrationsFolder : ' ./drizzle' ,
16+ } )
17+ await migrationConnection . end ( )
18+ console . log ( ' Migrations finished' )
19+ process . exit ( 0 )
1920}
2021
2122// 🔥 Run migrations
2223main ( ) . catch ( ( err ) => {
23- console . error ( err ) ;
24- process . exit ( 0 ) ;
25- } ) ;
24+ console . error ( err )
25+ process . exit ( 0 )
26+ } )
You can’t perform that action at this time.
0 commit comments