File tree Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Expand file tree Collapse file tree 1 file changed +15
-12
lines changed Original file line number Diff line number Diff line change 11const config = require ( 'config' ) ;
2- const { Sequelize } = require ( " sequelize" ) ;
3- const { Umzug , SequelizeStorage } = require ( " umzug" ) ;
2+ const { Sequelize } = require ( ' sequelize' ) ;
3+ const { SequelizeStorage } = require ( ' umzug' ) ;
44
55// Initialize Sequelize
66const sequelize = new Sequelize ( config . get ( 'dbConfig.masterUrl' ) , {
7- dialect : " postgres" ,
7+ dialect : ' postgres' ,
88} ) ;
99
10- console . log ( __dirname ) ;
10+ console . log ( 'Umzug migrations running in:' , __dirname ) ;
1111
1212// Initialize Umzug
1313const umzug = new Umzug ( {
1414 migrations : {
15- glob : "__dirname/ migrations/*.js" ,
15+ glob : ' migrations/*.js' ,
1616 resolve : ( { name, path, context } ) => {
1717 const migration = require ( path ) ;
1818 return {
@@ -29,13 +29,16 @@ const umzug = new Umzug({
2929
3030// Run migrations
3131if ( require . main === module ) {
32- umzug . up ( ) . then ( ( ) => {
33- console . log ( "Migrations executed successfully" ) ;
34- process . exit ( 0 ) ;
35- } ) . catch ( ( err ) => {
36- console . error ( "Migration failed" , err ) ;
37- process . exit ( 1 ) ;
38- } ) ;
32+ umzug
33+ . up ( )
34+ . then ( ( ) => {
35+ console . log ( 'Migrations executed successfully' ) ;
36+ process . exit ( 0 ) ;
37+ } )
38+ . catch ( ( err ) => {
39+ console . error ( 'Migration failed' , err ) ;
40+ process . exit ( 1 ) ;
41+ } ) ;
3942}
4043
4144module . exports = umzug ;
You can’t perform that action at this time.
0 commit comments