Skip to content
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

Question: Batch updates & transactions #713

Closed
ltamrazov opened this issue Nov 6, 2020 · 2 comments
Closed

Question: Batch updates & transactions #713

ltamrazov opened this issue Nov 6, 2020 · 2 comments

Comments

@ltamrazov
Copy link

Hi,

We are looking for a migration tool that would allow us to also perform data migrations (like a bulk update on a table). Of course the best way to run these types of updates is through batches so as not to lock the table for a significant amount of time. I was wondering if this is something that is possible with this tool? Specifically, I'm wondering if each migration is automatically wrapped into a transaction and if we have control over this at all? Its my understanding if the entire thing will be wrapped into a transaction, no matter the batches the table will still be locked until the transaction is committed, correct?

Additionally, is it possible to maintain two instances of this on a single DB? the use case is that we would have one set of migrations that are required schema changes that would run on start up of the app and would block the app until they are complete, and a second set of migrations that are non blocking (like data changes) and can be kicked off separately after the app has started. However both of these would be on the same database.

Any insight would be really appreciated!

@wzrdtales
Copy link
Member

Not yet, see spec #687 for rough overview of how the future design will look like. And yes every migration is wrapped in a transaction, that is troublesome for big updates of course, but you can deactivate the transactions per migration and pretty much do the batching yourself right now, but there will be support for that with the upcoming version.

Additionally, is it possible to maintain two instances of this on a single DB? the use case is that we would have one set of migrations that are required schema changes that would run on start up of the app and would block the app until they are complete, and a second set of migrations that are non blocking (like data changes) and can be kicked off separately after the app has started. However both of these would be on the same database.

Sure just adjust the migration folder and the migration table and you're good to go.

@ltamrazov
Copy link
Author

Awesome, makes sense. Thank you for the clarification!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants