@@ -43,6 +43,9 @@ export class MigrationsService implements OnModuleInit {
4343 ) {
4444 const storageRoot = this . config . get < string > ( 'factorydrive.options.disks.local.config.root' , '/tmp' )
4545 this . lockLocation = posix . join ( storageRoot , 'migrations.lock' )
46+ this . logger . debug ( `Migration lock file location: ${ this . lockLocation } ` )
47+ this . logger . debug ( `Storage root: ${ storageRoot } ` )
48+ this . logger . debug ( `Process CWD: ${ process . cwd ( ) } ` )
4649 }
4750
4851 /**
@@ -239,8 +242,10 @@ export class MigrationsService implements OnModuleInit {
239242 try {
240243 // Ensure the directory exists before writing the file
241244 const lockDir = dirname ( this . lockLocation )
245+ this . logger . debug ( `Creating directory: ${ lockDir } ` )
242246 await mkdir ( lockDir , { recursive : true } )
243247
248+ this . logger . debug ( `Writing migration lock file to: ${ this . lockLocation } ` )
244249 await writeFile ( this . lockLocation , migrationTimestamp )
245250 await this . mongo . collection ( 'migrations' ) . insertOne ( {
246251 timestamp : parseInt ( migrationTimestamp ) ,
@@ -249,6 +254,8 @@ export class MigrationsService implements OnModuleInit {
249254 this . logger . log ( chalk . blue ( `Migration ${ chalk . bold ( '<' + migrationKey + '>' ) } done.` ) )
250255 } catch ( e ) {
251256 this . logger . error ( chalk . red ( `Error while updating migration lock file !` ) )
257+ this . logger . error ( `Lock file path: ${ this . lockLocation } ` )
258+ this . logger . error ( `Lock file directory: ${ dirname ( this . lockLocation ) } ` )
252259 this . logger . error ( e )
253260
254261 throw new Error ( 'Error while updating migration lock file !' )
0 commit comments