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: product pkey conflict caused by import.sql #24

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

4nt0ineB
Copy link

@4nt0ineB 4nt0ineB commented Oct 10, 2024

The Product PanacheEntity use a generated sequence, but manually adding products with hardcoded id in import.sql bypass the sequence increment, causing a conflict when POSTing a product from the swagger.
I managed to finish the course with a workaround, using nextval and altering the sequence to keep simple ids (1,2,3..).

@njlbenn
Copy link
Contributor

njlbenn commented Oct 11, 2024

Nice. I like the ALTER SEQUENT ... INCREMENT BY 1 workaround.

Before it was using a generated sequence and I replaced them with hardcoded IDs to simplify Exercise 14 e56fc91 .

Can you edit the exercise 14 README file so that the instructions say what it said before? e56fc91#diff-ae26915143c5e0794771625dcfae5d075105a5f3870ceb1c7af28f6574313a8e (i.e. to use curl to get the product IDs)

njlbenn
njlbenn previously approved these changes Oct 11, 2024
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.

2 participants