It is generating empty alterSequence when using with PostgreSQL
See original GitHub issueEnvironment
Spring Boot, Hibernate 5, Gradle
Liquibase Version: 4.6.1
Liquibase Integration & Version: <Pick one: CLI, maven, gradle, spring boot, servlet, etc.> gradle - 4.6.1 spring boots
Liquibase Extension(s) & Version:
Database Vendor & Version: PostgresSQL
Operating System Type & Version:
- macOS
Description
It generates changelog corretly, but it adds empty alterSequence at the end
<changeSet author="jenik (generated)" id="1637177424360-1">
<alterSequence sequenceName="hibernate_sequence"/>
</changeSet>
<changeSet author="jenik (generated)" id="1637177424360-2">
<alterSequence sequenceName="revision_sequence_generator"/>
</changeSet>
It seems like there is the bug in JIRA since 2016: https://liquibase.jira.com/browse/CORE-2495
Additional Context
I am considering writing script removing the alterSequences manually. 😄
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:14 (4 by maintainers)
Top Results From Across the Web
Liquibase generating empty ALTER SEQUENCE changes
My database is PostgreSQL 12. What am I missing? Is there a way to prevent liquibase from creating these changes?
Read more >Documentation: 15: ALTER SEQUENCE - PostgreSQL
ALTER SEQUENCE changes the parameters of an existing sequence generator. Any parameters not specifically set in the ALTER SEQUENCE command retain their prior ......
Read more >Why does Postgres generate an already used PK value?
PostgreSQL will not try to insert duplicate values on its own, it is you (your application, ORM included) who does. It can be...
Read more >How to Duplicate a Table in PostgreSQL - PopSQL
Sometimes it's useful to duplicate a table: create table dupe_users as (select * from users);
Read more >ALTER SEQUENCE - Oracle Help Center
Use the ALTER SEQUENCE statement to change the increment, minimum and maximum values, ... Use this clause to generate unique sequence numbers across...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Right, I am using single sequence for most entities. So I excluded just that one.
Hi, is that bug fixed? Some people encounter the same problem, but I guess liquibase has not fixed that bug.
Environment
changelog.yaml
error message
related link https://stackoverflow.com/q/60299107/7927573