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
Prevent multiple connections from running migrations at the same time #1094
Conversation
elhigu
commented
Dec 13, 2015
- Adds locking when migrations are started
- forceFreeMigrationsLock function to allow removing the lock manually
51b10f2
to
184e8ca
Compare
@rhys-vdw could you give this the final review. @dustinmartin made this almost ready, but didn't have time to give it a last touch in #1067. |
184e8ca
to
7e274f5
Compare
@elhigu Yep, will review this evening. |
return this._isLocked(trx) | ||
.then(isLocked => { | ||
if (isLocked) { | ||
throw new Error("Migration table is are already locked"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"is are" already locked.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will fix.
@elhigu Looking good. |
7e274f5
to
3dd5ac8
Compare
Prevent multiple connections from running migrations at the same time
@elhigu Thanks or finishing this up. Very much appreciated. When do you think the next release of knex will be that will include these changes? |
@dustinmartin Should do one soon. @elhigu is there anything else you'd like to see in the next release? |
@rhys-vdw there is still that one pull request about sqlite3 dialect escaping which I would like to get in. It fixes also some regressions from postgres string literal escaping from getting to release. |