@@ -48,6 +48,8 @@ public class FlywayConfigSnapshot {
4848 private final List <Class <?>> javaMigrations ;
4949 private final List <String > errorOverrides ;
5050 private final Map <String , String > placeholders ;
51+ private final Map <String , String > jdbcProperties ;
52+ private final List <Object > cherryPick ;
5153 private final String table ;
5254 private final String tablespace ;
5355 private final String defaultSchemaName ;
@@ -61,8 +63,12 @@ public class FlywayConfigSnapshot {
6163 private final Object encoding ;
6264 private final String initSql ;
6365 private final String licenseKey ;
66+ private final String url ;
67+ private final String user ;
68+ private final String password ;
6469 private final boolean skipDefaultResolvers ;
6570 private final boolean skipDefaultCallbacks ;
71+ private final boolean skipExecutingMigrations ;
6672 private final boolean placeholderReplacement ;
6773 private final boolean baselineOnMigrate ;
6874 private final boolean outOfOrder ;
@@ -84,8 +90,11 @@ public class FlywayConfigSnapshot {
8490 private final boolean batch ;
8591 private final boolean oracleSqlPlus ;
8692 private final boolean oracleSqlplusWarn ;
93+ private final String oracleKerberosConfigFile ;
94+ private final String oracleKerberosCacheFile ;
8795 private final boolean outputQueryResults ;
8896 private final int connectRetries ;
97+ private final int lockRetryCount ;
8998
9099 public FlywayConfigSnapshot (Flyway flyway ) {
91100 final Object config ;
@@ -259,6 +268,36 @@ public FlywayConfigSnapshot(Flyway flyway) {
259268 this .javaMigrationClassProvider = null ;
260269 this .createSchemas = true ;
261270 }
271+
272+ if (flywayVersion >= 70 ) {
273+ this .url = getValue (config , "getUrl" );
274+ this .user = getValue (config , "getUser" );
275+ this .password = getValue (config , "getPassword" );
276+ } else {
277+ this .url = null ;
278+ this .user = null ;
279+ this .password = null ;
280+ }
281+
282+ if (flywayVersion >= 70 && isFlywayPro ) {
283+ this .jdbcProperties = ImmutableMap .copyOf (getMap (config , "getJdbcProperties" ));
284+ this .cherryPick = ImmutableList .copyOf (getArray (config , "getCherryPick" ));
285+ this .skipExecutingMigrations = getValue (config , "isSkipExecutingMigrations" );
286+ this .oracleKerberosConfigFile = getValue (config , "getOracleKerberosConfigFile" );
287+ this .oracleKerberosCacheFile = getValue (config , "getOracleKerberosCacheFile" );
288+ } else {
289+ this .jdbcProperties = ImmutableMap .of ();;
290+ this .cherryPick = ImmutableList .of ();;
291+ this .skipExecutingMigrations = false ;
292+ this .oracleKerberosConfigFile = "" ;
293+ this .oracleKerberosCacheFile = "" ;
294+ }
295+
296+ if (flywayVersion >= 71 ) {
297+ this .lockRetryCount = getValue (config , "getLockRetryCount" );
298+ } else {
299+ this .lockRetryCount = 50 ;
300+ }
262301 }
263302
264303 private static <T > T getValue (Object target , String method ) {
@@ -313,6 +352,10 @@ public boolean isSkipDefaultCallbacks() {
313352 return skipDefaultCallbacks ;
314353 }
315354
355+ public boolean isSkipExecutingMigrations () {
356+ return skipExecutingMigrations ;
357+ }
358+
316359 public List <String > getSqlMigrationSuffixes () {
317360 return sqlMigrationSuffixes ;
318361 }
@@ -353,6 +396,14 @@ public Map<String, String> getPlaceholders() {
353396 return placeholders ;
354397 }
355398
399+ public Map <String , String > getJdbcProperties () {
400+ return jdbcProperties ;
401+ }
402+
403+ public List <Object > getCherryPick () {
404+ return cherryPick ;
405+ }
406+
356407 public MigrationVersion getTarget () {
357408 return target ;
358409 }
@@ -385,6 +436,18 @@ public String getLicenseKey() {
385436 return licenseKey ;
386437 }
387438
439+ public String getUrl () {
440+ return url ;
441+ }
442+
443+ public String getUser () {
444+ return user ;
445+ }
446+
447+ public String getPassword () {
448+ return password ;
449+ }
450+
388451 public List <Object > getLocations () {
389452 return locations ;
390453 }
@@ -477,6 +540,14 @@ public boolean isOracleSqlplusWarn() {
477540 return oracleSqlplusWarn ;
478541 }
479542
543+ public String getOracleKerberosConfigFile () {
544+ return oracleKerberosConfigFile ;
545+ }
546+
547+ public String getOracleKerberosCacheFile () {
548+ return oracleKerberosCacheFile ;
549+ }
550+
480551 public boolean isOutputQueryResults () {
481552 return outputQueryResults ;
482553 }
@@ -485,13 +556,18 @@ public int getConnectRetries() {
485556 return connectRetries ;
486557 }
487558
559+ public int getLockRetryCount () {
560+ return lockRetryCount ;
561+ }
562+
488563 @ Override
489564 public boolean equals (Object o ) {
490565 if (this == o ) return true ;
491566 if (o == null || getClass () != o .getClass ()) return false ;
492567 FlywayConfigSnapshot that = (FlywayConfigSnapshot ) o ;
493568 return skipDefaultResolvers == that .skipDefaultResolvers &&
494569 skipDefaultCallbacks == that .skipDefaultCallbacks &&
570+ skipExecutingMigrations == that .skipExecutingMigrations &&
495571 placeholderReplacement == that .placeholderReplacement &&
496572 baselineOnMigrate == that .baselineOnMigrate &&
497573 outOfOrder == that .outOfOrder &&
@@ -514,6 +590,7 @@ public boolean equals(Object o) {
514590 oracleSqlplusWarn == that .oracleSqlplusWarn &&
515591 outputQueryResults == that .outputQueryResults &&
516592 connectRetries == that .connectRetries &&
593+ lockRetryCount == that .lockRetryCount &&
517594 Objects .equals (resolvers , that .resolvers ) &&
518595 Objects .equals (errorHandlers , that .errorHandlers ) &&
519596 Objects .equals (resourceProvider , that .resourceProvider ) &&
@@ -526,6 +603,8 @@ public boolean equals(Object o) {
526603 Objects .equals (javaMigrations , that .javaMigrations ) &&
527604 Objects .equals (errorOverrides , that .errorOverrides ) &&
528605 Objects .equals (placeholders , that .placeholders ) &&
606+ Objects .equals (jdbcProperties , that .jdbcProperties ) &&
607+ Objects .equals (cherryPick , that .cherryPick ) &&
529608 Objects .equals (table , that .table ) &&
530609 Objects .equals (tablespace , that .tablespace ) &&
531610 Objects .equals (defaultSchemaName , that .defaultSchemaName ) &&
@@ -539,23 +618,31 @@ public boolean equals(Object o) {
539618 Objects .equals (encoding , that .encoding ) &&
540619 Objects .equals (initSql , that .initSql ) &&
541620 Objects .equals (licenseKey , that .licenseKey ) &&
542- Objects .equals (installedBy , that .installedBy );
621+ Objects .equals (installedBy , that .installedBy ) &&
622+ Objects .equals (url , that .url ) &&
623+ Objects .equals (user , that .user ) &&
624+ Objects .equals (password , that .password ) &&
625+ Objects .equals (oracleKerberosConfigFile , that .oracleKerberosConfigFile ) &&
626+ Objects .equals (oracleKerberosCacheFile , that .oracleKerberosCacheFile );
543627 }
544628
545629 @ Override
546630 public int hashCode () {
547631 return Objects .hash (
548632 resolvers , errorHandlers , resourceProvider , javaMigrationClassProvider ,
549633 baselineVersion , target , locations , schemas , sqlMigrationSuffixes ,
550- javaMigrations , errorOverrides , placeholders , table , tablespace , defaultSchemaName ,
634+ javaMigrations , errorOverrides , placeholders , jdbcProperties , cherryPick ,
635+ table , tablespace , defaultSchemaName ,
551636 baselineDescription , undoSqlMigrationPrefix , repeatableSqlMigrationPrefix ,
552637 sqlMigrationSeparator , sqlMigrationPrefix , placeholderPrefix ,
553- placeholderSuffix , encoding , initSql , licenseKey ,
554- skipDefaultResolvers , skipDefaultCallbacks , placeholderReplacement , baselineOnMigrate ,
555- outOfOrder , ignoreMissingMigrations , ignoreIgnoredMigrations , ignorePendingMigrations ,
638+ placeholderSuffix , encoding , initSql , licenseKey , url , user , password ,
639+ skipDefaultResolvers , skipDefaultCallbacks , skipExecutingMigrations ,
640+ placeholderReplacement , baselineOnMigrate , outOfOrder ,
641+ ignoreMissingMigrations , ignoreIgnoredMigrations , ignorePendingMigrations ,
556642 ignoreFutureMigrations , validateMigrationNaming , validateOnMigrate ,
557643 cleanOnValidationError , cleanDisabled , allowMixedMigrations , createSchemas ,
558644 mixed , group , installedBy , dryRun , stream , batch ,
559- oracleSqlPlus , oracleSqlplusWarn , outputQueryResults , connectRetries );
645+ oracleSqlPlus , oracleSqlplusWarn , oracleKerberosConfigFile , oracleKerberosCacheFile ,
646+ outputQueryResults , connectRetries , lockRetryCount );
560647 }
561648}
0 commit comments