quarkus: Quarkus 3 update script: ERROR: relation "hibernate_sequence" does not exist
Description
Not sure how, but it would be nice if the quarkus update --stream=3.0
script could add create sequence hibernate_sequence start with 1 increment by 1;
preceding import statements since the previous version of Hibernate would allow you to do statements such as:
INSERT INTO Fruit(id,name,season) VALUES (nextval('hibernate_sequence'),'Mango','Spring');
which now error out with: relation “hibernate_sequence” does not exist
Implementation ideas
No response
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 15 (14 by maintainers)
I wouldn’t even go as far as make it parse the sql - but just look for common pattern - but I agree can be a bit too faulty.
btw. openrewrite plugins can do anything. just that someone need to write those plugins.
This is a bit of a special case but it would be nice to even just have the update tooling detect “hey, import.sql is referring to hibernate_sequence. You might need to change that to a sequence per table. Link to more docs” and add that to a “read_afterupdate.md” file or similar - as we might not do perfect migrations but can at least detect possible issues and recommend/document options.
I have a bad feeling that if we can’t do the right thing in the automated tooling (and I appreciate its complex), some of our users might have even less chance of being able to do the right thing. I base this entirely on my own experience. 😃
One thing that would help is a few examples in the docs to copy and paste from. I was able to make my upgrade work by finding someone who’d done a similar update and copying their code. There won’t be a single copy-pastable thing that works for all cases, but if we have a few examples of different things that might work, it’s something for users to experiment with. It’s also something concrete that they can feed into their favourite search engine to understand what the code snippets are showing.
I’m going to close this issue since I don’t think we can do more than document the steps to go through in the migration guide.
Feel free to add another message and ping me if you still think we could still do something more in Quarkus despite my explanation above.