Skip to content

Commit 6497b3d

Browse files
committed
Ensure that Liquibase pre-conditions work for MongoDB
Fixes: #50406
1 parent c3944a9 commit 6497b3d

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

extensions/liquibase/liquibase-mongodb/deployment/src/main/java/io/quarkus/liquibase/mongodb/deployment/LiquibaseMongodbProcessor.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ void nativeImageConfiguration(
113113
runtimeInitialized.produce(new RuntimeInitializedClassBuildItem(
114114
liquibase.sqlgenerator.core.LockDatabaseChangeLogGenerator.class.getName()));
115115

116+
reflective.produce(ReflectiveClassBuildItem.builder(
117+
liquibase.precondition.PreconditionLogic.class.getName())
118+
.reason(getClass().getName())
119+
.fields().build());
120+
116121
reflective.produce(ReflectiveClassBuildItem.builder(
117122
liquibase.change.AbstractSQLChange.class.getName(),
118123
liquibase.ext.mongodb.change.AbstractMongoChange.class.getName(),

integration-tests/liquibase-mongodb/src/main/resources/liquibase/changelog.xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
http://www.liquibase.org/xml/ns/dbchangelog-ext https://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
77

88
<changeSet id="1" author="loic">
9+
<preConditions onFail="WARN">
10+
<ext:collectionExists name="test"/>
11+
</preConditions>
912

1013
<ext:createCollection collectionName="Fruit"/>
1114

@@ -20,4 +23,4 @@
2023

2124
</changeSet>
2225

23-
</databaseChangeLog>
26+
</databaseChangeLog>

0 commit comments

Comments
 (0)