@@ -121,23 +121,23 @@ class Version extends Model {}
121121
122122const getDB = ( ) => sequelize ;
123123
124- const setConfiguration = ( key , path , dialectPath ) => {
124+ const setConfiguration = ( key , path ) => {
125125 sequelize = new Sequelize ( null , null , key , {
126126 dialect : 'sqlite' ,
127- dialectModulePath : dialectPath || '@journeyapps/sqlcipher' ,
127+ dialectModulePath : '@journeyapps/sqlcipher' ,
128128 storage : path || myDBEncryptPath ( ) ,
129129 logging : false ,
130130 transactionType : 'IMMEDIATE'
131131 } ) ;
132132} ;
133133
134134const initDatabaseEncrypted = async (
135- { key, shouldReset, path , sync = true , dialectPath } ,
135+ { key, shouldReset, dbpath , sync = true } ,
136136 migrationStartCallback
137137) => {
138138 if ( shouldReset ) sequelize = undefined ;
139139 if ( sequelize ) return ;
140- await setConfiguration ( key , path , dialectPath ) ;
140+ await setConfiguration ( key , dbpath ) ;
141141
142142 Account . init (
143143 {
@@ -607,10 +607,11 @@ const initDatabaseEncrypted = async (
607607
608608 try {
609609 const migrationPath = path . join ( __dirname , '/DBEmigrations' ) ;
610+ const umzugPath = getUmzugPath ( process . env . NODE_ENV ) ;
610611 const migrator = new umzug ( {
611612 storage : 'json' ,
612613 storageOptions : {
613- path : getUmzugPath ( process . env . NODE_ENV )
614+ path : umzugPath
614615 } ,
615616 logging : false ,
616617 upName : 'up' ,
@@ -634,7 +635,7 @@ const initDatabaseEncrypted = async (
634635 } catch ( ex ) {
635636 logger . error ( {
636637 message : 'Migrating Database' ,
637- error : ex
638+ error : ex . toString ( )
638639 } ) ;
639640 }
640641} ;
0 commit comments