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
docs: How to run migrations outside a transaction #4775
Comments
To disable transactions you need to use |
This is actually a bug, as we need to respect the master transaction even if you disable the per migration transaction, will fix that in a minute. But I believe you still need the |
And thinking about this more, I guess we could also run such migrations outside of the master transaction right ahead, so you do not need to disable the flag explicitly. The code is already trying to do that, but it timeouts as we only allow single connection in the pool, and we need a second one for such use case. |
Thanks, using |
It should actually work without that too with latest version. |
For what it's worth, I tried updating from 5.6.16 to 5.8.6 and commented out the |
I just opened a small PR here in case it's helpful, just mentioning the config option in the isTransactional section! #4778 |
Repro welcome, it does work just fine on my end, tried in the realworld example app.
Well, with the changes I made, this is no longer true, so please provide the repro instead. Maybe its something I missed, I was only checking whether it won't get stuck again as it was before. |
I discovered the documentation here which mentions that you can implement an
isTransactional()
method in your migration to run it non-transactionally:But I'm running into a connexion problem when I run this (
Knex: Timeout acquiring a connection. The pool is probably full. Are you missing a .transacting(trx) call?
) - but if I remove theCONCURRENTLY
and run it inside a transaction as normal it works perfectly. It makes me wonder if I am missing a step or two here to get it up and running properly?If so, perhaps it could be helpful to have a more detailed example in the docs? But equally if this is a bug I'm happy to provide a bit more information here
The text was updated successfully, but these errors were encountered: