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

Prevent multiple connections from running migrations at the same time #1094

Merged
merged 7 commits into from Dec 15, 2015

Conversation

elhigu
Copy link
Member

@elhigu elhigu commented Dec 13, 2015

  • Adds locking when migrations are started
  • forceFreeMigrationsLock function to allow removing the lock manually

@elhigu
Copy link
Member Author

elhigu commented Dec 13, 2015

@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.

@rhys-vdw
Copy link
Member

@elhigu Yep, will review this evening.

return this._isLocked(trx)
.then(isLocked => {
if (isLocked) {
throw new Error("Migration table is are already locked");
Copy link
Member

Choose a reason for hiding this comment

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

"is are" already locked.

Copy link
Member Author

Choose a reason for hiding this comment

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

will fix.

@rhys-vdw
Copy link
Member

@elhigu Looking good.

elhigu added a commit that referenced this pull request Dec 15, 2015
Prevent multiple connections from running migrations at the same time
@elhigu elhigu merged commit d105924 into knex:master Dec 15, 2015
@dustinmartin
Copy link
Contributor

@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?

@rhys-vdw
Copy link
Member

@dustinmartin Should do one soon. @elhigu is there anything else you'd like to see in the next release?

@elhigu
Copy link
Member Author

elhigu commented Dec 17, 2015

@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.

@elhigu elhigu deleted the migration-lock branch January 21, 2016 07:57
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.

None yet

3 participants