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

Fix transaction support for migrations #3084

Merged
merged 7 commits into from Mar 13, 2019

Conversation

kibertoad
Copy link
Collaborator

fixes #3063

@kibertoad kibertoad requested a review from elhigu March 3, 2019 23:52
@kibertoad
Copy link
Collaborator Author

kibertoad commented Mar 3, 2019

This fix makes an assumption that we had a pretty good reason why we don't want to modify or clone transaction instances, hence we are only ensuring that they work as much as they used before. If it is OK to modify or clone transaction instances, better solution could be implemented

Latest version makes processing disabling work on transactions as well.

this.knex = knex.withUserParams({
...knex.userParams,
});
this.knex.disableProcessing();
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this inside operations instead to ensure correct state before each of them, regardless of how previous ones ended.

@kibertoad kibertoad merged commit 24fcf27 into master Mar 13, 2019
@kibertoad kibertoad deleted the fix/3063-migrations-in-transactions branch March 13, 2019 21:47
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

Successfully merging this pull request may close these issues.

Migrations can no longer be run from within a transaction
1 participant