Closed lucassilvas1 closed 2 months ago
Why was this closed? I still don't know why the migration is causing the process to exit, I get no errors or anything, so I have no idea what to look for.
Hey 👋
If you don't post an error message/stacktrace, or a reproduction repository, there's nothing we can do to help. You haven't made the minimal steps towards that. We are not here to debug with you.
Try wrapping the migration with a try-catch block and print errors and rethrow.
Description
Out of nowhere, calls to
Migrator.migrateToLatest()
are simply causing the Node process to exit with code 0. This happens even when the migration folder is empty, so I know it's not a specific migration causing the issue. In the snippet below, onlyconsole.log("BEFORE migrateToLast CALL")
is called, but notconsole.log("AFTER migrateToLast CALL")
orconsole.log("ERROR AFTER migrateToLast CALL", error)
. The process straight up exits afterawait migrator.migrateToLatest()
.EDIT: Turns out I forgot to delete the transpiled migration JavaScript files when I was checking if one of my migrations was the culprit. I managed to narrow down the cause of the problem to one of my migrations, but I still don't know why it is causing the process to exit.
This is migration file:
I'm not experienced with SQL, specially not SQLite which is what this project uses, so there's likely better ways of doing it, but surely it shouldn't cause the app to just exit?