-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Sequence owned by a table field must be included in database snapshot #3335
Sequence owned by a table field must be included in database snapshot #3335
Conversation
…d is not detected as SERIAL is created as an ordinary sequence.
…d is not detected as SERIAL is created as an ordinary sequence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code review and test results:
Things to be aware of:
- Failing test harness test in unrelated
- Just impacts postgresql
- Fixes postgres < 10 and 10+
- Adds integration test for issue
Things to worry about:
- Nothing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR address a bug in Liquibase handling of the Postgres sequence OWNED BY
clause. With the fix, Liquibase diff-changelog creates an ALTER SEQUENCE
instead of a DROP SEQUENCE
changeset for a Postgres sequence that differs only due to a change in the OWNED BY
clause.
- New integration tests added.
- No additional testing required.
APPROVED
…fchangelog-dropping-sequences-erroneously # Conflicts: # liquibase-integration-tests/src/test/java/liquibase/dbtest/pgsql/PostgreSQLIntegrationTest.java
Impact
Description
When a sequence is owned by a table field it looks like very much an auto increment sequence in postgres catalogs. Because of that liquibase was skiping this sequence when doing a snapshot of the databse.
This PR makes sure that any sequence that is owned by a table field and is not used as auto increment (serial) is snapshoted as an ordinary sequence.
Things to be aware of
Things to worry about
Additional Context