-
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
Updated PrimaryKeyExistsPrecondition to require table name for H2 databases #5323
Updated PrimaryKeyExistsPrecondition to require table name for H2 databases #5323
Conversation
…abases This commit updates the PrimaryKeyExistsPrecondition class in order to throw an exception when no table name is provided while using H2 database. This change has been done because the H2 database driver requires a table name to be specified for searching a primary key.
…-when-used-with-h2-2x
…r MySQL when tableName is not provided. - Update test. - Update test data.
… is not specified to H2 and MySQL test suites. - Add integration test to validate no error is returned for others DBs.
- Added integration test for these new applied DBs. - Update existent abstract integration test.
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 changes looks good to me. I have add some other DBs so precondition returns the same given error and added some integration tests.
@rberezen Would you mind looking at the test cases added and see if they look good enough for you?
Thanks,
Daniel.
…-when-used-with-h2-2x
liquibase-integration-tests/src/test/java/liquibase/dbtest/AbstractIntegrationTest.java
Show resolved
Hide resolved
Docs internal: https://datical.atlassian.net/browse/PD-4392 |
Impact
Description
This PR updates the PrimaryKeyExistsPrecondition in order to throw a friendly message when no table name is provided while using H2 database. This change has been done because the H2 database driver requires a table name to be specified for searching a primary key.
Doc notes
This precondition fails on databases which don't support the null as third parameter Documentation is required on https://docs.liquibase.com/concepts/changelogs/preconditions.html mentioning that due to JDBC driver limitations, is some databases such as H2 the tableName is required.
Fixes #3643