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

remove guessing of next auto_increment id #2

Closed
wants to merge 1 commit into from
Closed

remove guessing of next auto_increment id #2

wants to merge 1 commit into from

Conversation

Towerful
Copy link

@Towerful Towerful commented Jul 2, 2015

Getting the max() + 1 of the id column does not reliably return the next used auto_increment id.
This PR adds an extra query in order to save the model, then update the model with the newly used ID.
This will remove badly guessed IDs from deletions and race conditions of multiple concurrent saves

p.s. my first ever PR. I hope all is in order.
Feedback is appreciated :)

Getting the `max() + 1` of the id column does not reliably return the next used auto_increment id.
This PR adds an extra query in order to save the model, then update the model with the newly used ID.
This will remove badly guessed IDs from deletions and race conditions of multiple concurrent saves
@Towerful
Copy link
Author

Towerful commented Jul 2, 2015

damn, PR sent to the wrong place. meant to send to sbarre/eloquent-versioned.
Sorry!

@Towerful Towerful closed this Jul 2, 2015
@Towerful Towerful deleted the fix-getNextModelId branch July 2, 2015 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant