From f955f88fe8fd201884aef8e11861e15c18a5bf4e Mon Sep 17 00:00:00 2001 From: Guschtel Date: Tue, 8 Oct 2024 17:22:42 +0200 Subject: [PATCH] Removes validate differences when comparing an Oracle Database Schema against a Spring Jpa / HibernateDatabase (#719) --- .../ext/hibernate/diff/ChangedForeignKeyChangeGenerator.java | 1 + .../ext/hibernate/diff/ChangedPrimaryKeyChangeGenerator.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/liquibase/ext/hibernate/diff/ChangedForeignKeyChangeGenerator.java b/src/main/java/liquibase/ext/hibernate/diff/ChangedForeignKeyChangeGenerator.java index 16626949..03526919 100644 --- a/src/main/java/liquibase/ext/hibernate/diff/ChangedForeignKeyChangeGenerator.java +++ b/src/main/java/liquibase/ext/hibernate/diff/ChangedForeignKeyChangeGenerator.java @@ -28,6 +28,7 @@ public Change[] fixChanged(DatabaseObject changedObject, ObjectDifferences diffe if (referenceDatabase instanceof HibernateDatabase || comparisonDatabase instanceof HibernateDatabase) { differences.removeDifference("deleteRule"); differences.removeDifference("updateRule"); + differences.removeDifference("validate"); if (!differences.hasDifferences()) { return null; } diff --git a/src/main/java/liquibase/ext/hibernate/diff/ChangedPrimaryKeyChangeGenerator.java b/src/main/java/liquibase/ext/hibernate/diff/ChangedPrimaryKeyChangeGenerator.java index 22787266..39fed86e 100644 --- a/src/main/java/liquibase/ext/hibernate/diff/ChangedPrimaryKeyChangeGenerator.java +++ b/src/main/java/liquibase/ext/hibernate/diff/ChangedPrimaryKeyChangeGenerator.java @@ -27,6 +27,7 @@ public int getPriority(Class objectType, Database data public Change[] fixChanged(DatabaseObject changedObject, ObjectDifferences differences, DiffOutputControl control, Database referenceDatabase, Database comparisonDatabase, ChangeGeneratorChain chain) { if (referenceDatabase instanceof HibernateDatabase || comparisonDatabase instanceof HibernateDatabase) { differences.removeDifference("unique"); + differences.removeDifference("validate"); if (!differences.hasDifferences()) { return null; }