Skip to content

Commit 1bcc35a

Browse files
authored
Fix flyway-database-postgresql's transactional lock setting (#648)
The metadata for flyway-database-postgresql did not allow org.flywaydb.database.postgresql.TransactionalModel to be serialized to JSON. This resulted in a failure if the setTransactionalLock method on PostgreSQLConfigurationExtension was called in a native image. This commit adds the necessary metadata and updates the existing test to cover this code path.
1 parent bf30f26 commit 1bcc35a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

metadata/org.flywaydb/flyway-database-postgresql/10.10.0/reflect-config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,13 @@
66
},
77
"allPublicConstructors": true,
88
"allPublicMethods": true
9+
},
10+
{
11+
"name": "org.flywaydb.database.postgresql.TransactionalModel",
12+
"condition": {
13+
"typeReachable": "org.flywaydb.core.internal.plugin.PluginRegister"
14+
},
15+
"allPublicConstructors": true,
16+
"allPublicMethods": true
917
}
1018
]

tests/src/org.flywaydb/flyway-database-postgresql/10.10.0/src/test/java/flyway/database/postgresql/FlywayDatabasePostgresqlTests.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.flywaydb.core.api.configuration.Configuration;
1818
import org.flywaydb.core.api.configuration.FluentConfiguration;
1919
import org.flywaydb.core.api.output.MigrateResult;
20+
import org.flywaydb.database.postgresql.PostgreSQLConfigurationExtension;
2021
import org.junit.jupiter.api.AfterAll;
2122
import org.junit.jupiter.api.BeforeAll;
2223
import org.junit.jupiter.api.Test;
@@ -68,6 +69,9 @@ void migrate() {
6869
.dataSource(dataSource)
6970
.encoding(StandardCharsets.UTF_8)
7071
.resourceProvider(new FixedResourceProvider());
72+
configuration.getPluginRegister()
73+
.getPlugin(PostgreSQLConfigurationExtension.class)
74+
.setTransactionalLock(false);
7175

7276
Flyway flyway = new Flyway(configuration);
7377
MigrateResult migration = flyway.migrate();

0 commit comments

Comments
 (0)