-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug fix: unable to run migration from compiled files #376
Conversation
- Set default formatter - Disable editor validate (use biome)
$ cd examples/config-file-usage $ npx tsc
Also just a general question you are the second person who compiles migrations, what is the use-case for that? Basically you expanding on this idea that was recently added, now I'm thinking this was a mistake to add in the first place) |
I build migrations with source code, and run it using nodejs, no tsc. |
Yeah but why you do it this way? Is there a reason for it? Wait you don't use typescript, in your project? |
We also have programmatic approach of running migrations |
Because if the migration contains other dependencies, for example lodash. Then node_modules must be kept in the build, which is not very reasonable. |
Whether or not you need |
For small applications, bundling is useful using tree-shaking, some tools like |
Yeah exactly what I thought, I guess ncc is a good example surprisingly built on top of web-pack (thought it was dead), but at this point you do basically serverless. Ok now lets look at this from standpoint of the lib, do we really need all these after compilation use cases What if we improve documentation instead, and describe the intended use |
If the library can accommodate both usages, with just a few minor changes, that's even better. |
Your tests are hanging indefinitely, probably you are not closing migrator or some dangling connections |
The connection in getModels is causing this issue
|
Lets update docs about connection passed as first prop in migration functions |
Thanks for this. Just an FYI we also run migrations once they've been compiled into JS. |
I wrote migration using ts but when building and running on production environment, compiled js files have module not found error. The reason is because the extension is fixed as
.ts
.Realizing that nodejs and typescript do not require extension so I removed them in this PR.