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

✨ Generate Primary Keys. #635

Merged
merged 4 commits into from
Sep 9, 2024
Merged

✨ Generate Primary Keys. #635

merged 4 commits into from
Sep 9, 2024

Conversation

jortel
Copy link
Contributor

@jortel jortel commented May 7, 2024

Generate primary keys instead of GORM.
This fixes the issue of GORM reusing the highest key after the model with that ID is deleted.
When the PK is 0, GORM assigns the next (highest) ID.

This approach is to assign the ID ahead of time using a pool managed by tackle.

@jortel jortel self-assigned this May 7, 2024
@jortel jortel changed the title ✨ Generate PK ✨ Generate Primary Keys. Jun 6, 2024
@jortel jortel force-pushed the genkeys branch 2 times, most recently from a54ea3e to 3a8f00a Compare July 9, 2024 21:42
@jortel jortel marked this pull request as ready for review July 16, 2024 16:00
migration/v15/model/core.go Outdated Show resolved Hide resolved
database/pk.go Show resolved Hide resolved
@jortel jortel force-pushed the genkeys branch 2 times, most recently from 537f6be to 18e5c4a Compare August 21, 2024 20:55
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
Signed-off-by: Jeff Ortel <[email protected]>
@jortel jortel force-pushed the genkeys branch 2 times, most recently from ec1b59a to 18e5766 Compare September 6, 2024 15:48
@jortel jortel merged commit 58960d8 into konveyor:main Sep 9, 2024
29 of 31 checks passed
dymurray pushed a commit that referenced this pull request Oct 11, 2024
Generate primary keys instead of GORM.
This fixes the issue of GORM reusing the highest key after the model
with that ID is deleted.
When the PK is 0, GORM assigns the next (highest) ID.

This approach is to assign the ID ahead of time using a pool managed by
tackle.

---------

Signed-off-by: Jeff Ortel <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants