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

DAT-18191 and DAT-18192 - Fix classpath loading and incorrect configuration for addForeignKeyConstraint #6109

Merged
merged 5 commits into from
Oct 3, 2024

Conversation

filipelautert
Copy link
Collaborator

@filipelautert filipelautert commented Jul 17, 2024

The calls being modified here should not be in those locations as they happen before all classloading is complete, thus causing incorrect evaluations of available classes.

To be more specific, DatabaseFactory is called before classpath parameter is evaluated by command line, causing extension that provide support to other databases that are pointed out by "classpath" parameter to not be loaded.

Fix liquibase/liquibase-docs#105

@filipelautert filipelautert self-assigned this Jul 17, 2024
@filipelautert filipelautert marked this pull request as ready for review August 30, 2024 14:58
@filipelautert filipelautert changed the title DAT-18191 and DAT-18192 - Fix classpath loading DAT-18191 and DAT-18192 - Fix classpath loading and incorrect configuration for addForeignKeyConstraint Aug 30, 2024
@filipelautert filipelautert merged commit dd20cf1 into master Oct 3, 2024
7 of 9 checks passed
@filipelautert filipelautert deleted the DAT-18191 branch October 3, 2024 20:54
filipelautert added a commit that referenced this pull request Oct 9, 2024
…ration for addForeignKeyConstraint (#6109)

* fix: do not call DatabaseFactory before classpath parameter is evaluated by command line

* chore: document changes/ refactor code

* chore: remove offending method

* fix: how sqlite supports initiallyDeferred and deferred if it doesn't work with addForeignKey ?!

* fix: typo
filipelautert added a commit that referenced this pull request Oct 28, 2024
* changed code, started with test

* Base tests

* Modify tests

* working on the groovy test

* test: change order of stream closing and file deletion (#6380)

* DAT-18563 :: Unhide tag parameter for UpdateTestingRollback command (#6330)

- Unhide tag parameter for UpdateTestingRollback command.
- Update command test.
- Added integration test.

* Removed usage of deprecated isEmpty() method (#6205)

Removed usage of deprecated isEmpty method

Co-authored-by: Daniel Mallorga <[email protected]>
Co-authored-by: Daniel Mallorga <[email protected]>
Co-authored-by: filipe <[email protected]>

* #6281 fix NPE when default value is null (#6287)

Sample:
```java
java.lang.NullPointerException: Cannot invoke "String.replaceAll(String, String)" because "defaultValue" is null
	at liquibase.snapshot.jvm.ColumnSnapshotGenerator.readDefaultValue(ColumnSnapshotGenerator.java:571)
	at liquibase.snapshot.jvm.ColumnSnapshotGenerator.readColumn(ColumnSnapshotGenerator.java:291)
	at liquibase.snapshot.jvm.ColumnSnapshotGenerator.addTo(ColumnSnapshotGenerator.java:204)
	at liquibase.snapshot.jvm.JdbcSnapshotGenerator.snapshot(JdbcSnapshotGenerator.java:78)
	at liquibase.snapshot.SnapshotGeneratorChain.snapshot(SnapshotGeneratorChain.java:49)
```

* #6264 avoid ignoring the caught exception (#6288)

* delete unused class UnknownConfigurationType

* init field DatabaseIncapableOfOperation.operation

it was not assigned in constructor; thus it was always NULL.

P.S. This field is not used, so it should be removed.

* #6264 avoid ignoring the caught exception

I found all places where IDEA shows warning "catch block may ignore exception", and fixed many of them.

* Adressing issue #6331, small changes to pom.xml files to reduce warnings shown in building (#6332)

Use ${project.version} instead of ${version}; same goes for ${build.finalName}, which is recommended to switch to ${project.build.finalName}.  Finally, use version for `maven-jar-plugin` consistently.

Co-authored-by: Carlo Dapor <[email protected]>

* DAT-18743: dry-run: add current_branch_name (#6382)

* missing ending fi statement

* add simple logic, if the branch is neither "release" nor "master," it sets branch to the current branch name.

* populate the value of the branch in dry-run-release.yml and pass it as outputs

* populate the value of the branch in dry-run-release.yml and pass it as outputs

---------

Co-authored-by: Sayali M <sayali@Sayalis-MacBook-Pro>

* DAT-18329: comment out pieces of code that builds the Mac Installer (#6379)

* comment out pieces of code that build the Mac Installer

* delete macOS from install4j software and results produced are commented out

* remove mac references

---------

Co-authored-by: Sayali M <sayali@Sayalis-MacBook-Pro>

* Handle Oracle blank schema names DAT-18199 (#6305)

* Handle Oracle blank schema names

DAT-18199

* Added comment DAT-18199

* Tweak last fix

DAT-18199

* Another fix for the last fix

DAT-18199

---------

Co-authored-by: suryaaki2 <[email protected]>

* DAT-18191 and DAT-18192 - Fix classpath loading and incorrect configuration for addForeignKeyConstraint (#6109)

* fix: do not call DatabaseFactory before classpath parameter is evaluated by command line

* chore: document changes/ refactor code

* chore: remove offending method

* fix: how sqlite supports initiallyDeferred and deferred if it doesn't work with addForeignKey ?!

* fix: typo

* Handle blank change set ID DAT-18687 (#6359)

* WIP

DAT-18687

* Handle blank change set IDs

DAT-18687

* Add JavaDoc and another test

---------

Co-authored-by: suryaaki2 <[email protected]>

* allow replaceIfExists in Postgres procedures (DAT-18495) (#6350)

* allow replaceIfExists in Postgres procedures

* reduce code duplication

* CreateProcedure definition test updated to include postgresql as a supported database.

---------

Co-authored-by: obovsunivskyii <[email protected]>
Co-authored-by: Daniel Mallorga <[email protected]>
Co-authored-by: suryaaki2 <[email protected]>

* fix CreateProcedureChange not working with mariadb (DAT-18495) (#6389)

* Bump groovy.version from 4.0.22 to 4.0.23 (#6319)

Bumps `groovy.version` from 4.0.22 to 4.0.23.

Updates `org.apache.groovy:groovy-bom` from 4.0.22 to 4.0.23
- [Commits](https://github.com/apache/groovy/commits)

Updates `org.apache.groovy:groovy-all` from 4.0.22 to 4.0.23
- [Commits](https://github.com/apache/groovy/commits)

---
updated-dependencies:
- dependency-name: org.apache.groovy:groovy-bom
  dependency-type: direct:production
  update-type: version-update:semver-patch
- dependency-name: org.apache.groovy:groovy-all
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Add support for include columns in indexes (#6138)

* Update ABOUT.txt

* trying to get include columns to work with indexes

* Update ABOUT.txt

* Now with passing tests

* got creating indexes to work properly. Still need to get generate changelog to work

* got the generate-changelog command working with indexes that include columns

* cleanup unnecesary changes in the diff

* Added include field to the xsd

* updated to use booleanutils

* switched to non deprecated method

* Added unit test coverage for index include feature

* put generator into an if statement based on database

* put more sections behind ifs on db type

* do not strip "classpath:" when normalizing the path (#5894)

This PR introduces an alternative behavior for sub-resource path resolution, namely if a root resource path starts with the classpath: prefix, it would preserve that prefix when resolving sub-resource locations. This behavior is activated with liquibase.preserveClasspathPrefixInNormalizedPaths property (it must be set to true), or via LIQUIBASE_PRESERVE_CLASSPATH_PREFIX_IN_NORMALIZED_PATHS variable or --preserve-classpath-prefix-in-normalized-paths CLI option. This feature allows to implement custom ResourceAccessors that work with abstract URLs without being directly tied to the filesystem, such as the one in Bootique.io.

* Handle Snowflake add NOT NULL constraint DAT-18798 (#6391)

* Fix generated SQL for Snowflake NOT NULL constraint

DAT-18798

* Handle Snowflake NOT NULL constraint

DAT-18798

---------

Co-authored-by: obovsunivskyii <[email protected]>

* chore: changes to make the test work - as it will be a PreparedStatement it needs to be supportsBatchUpdates - and as we are offline we need to override it.

* Remove print statement

* changed code, started with test

* Base tests

* Modify tests

* working on the groovy test

* chore: changes to make the test work - as it will be a PreparedStatement it needs to be supportsBatchUpdates - and as we are offline we need to override it.

* Remove print statement

* Changed string for the oracle clob test

* Update names.csv

* chore: take isRelativeToChangelogFile into account when evaluating the file location.

* chore: fix variable name and tests

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: tatibeans <[email protected]>
Co-authored-by: Steven Massaro <[email protected]>
Co-authored-by: Daniel Mallorga <[email protected]>
Co-authored-by: Anton Erofeev <[email protected]>
Co-authored-by: Daniel Mallorga <[email protected]>
Co-authored-by: filipe <[email protected]>
Co-authored-by: Andrei Solntsev <[email protected]>
Co-authored-by: catull <[email protected]>
Co-authored-by: Carlo Dapor <[email protected]>
Co-authored-by: Sayali Mohadikar <[email protected]>
Co-authored-by: Sayali M <sayali@Sayalis-MacBook-Pro>
Co-authored-by: Wesley Willard <[email protected]>
Co-authored-by: suryaaki2 <[email protected]>
Co-authored-by: obovsunivskyii <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Stephen Atwell <[email protected]>
Co-authored-by: Andrus Adamchik <[email protected]>
Co-authored-by: filipe <[email protected]>
Co-authored-by: rberezen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

addForeignKeyConstraint documentation is inconsistent regarding SQLite
4 participants