@@ -31,11 +31,13 @@ public class FlywayConfigSnapshot {
3131 private final Object [] callbacks ; // the callbacks are modified during the migration
3232
3333 // included in equals and hashCode methods
34- // but it will work only for empty arrays (that is common use-case)
34+ // but it will work only for empty arrays or null values (that is common use-case)
3535 // because of missing equals and hashCode methods
3636 // on classes implementing these interfaces
3737 private final List <MigrationResolver > resolvers ;
3838 private final List <Object > errorHandlers ;
39+ private final Object resourceProvider ;
40+ private final Object javaMigrationClassProvider ;
3941
4042 // included in equals and hashCode methods
4143 private final MigrationVersion baselineVersion ;
@@ -48,6 +50,7 @@ public class FlywayConfigSnapshot {
4850 private final Map <String , String > placeholders ;
4951 private final String table ;
5052 private final String tablespace ;
53+ private final String defaultSchemaName ;
5154 private final String baselineDescription ;
5255 private final String undoSqlMigrationPrefix ;
5356 private final String repeatableSqlMigrationPrefix ;
@@ -67,10 +70,12 @@ public class FlywayConfigSnapshot {
6770 private final boolean ignoreIgnoredMigrations ;
6871 private final boolean ignorePendingMigrations ;
6972 private final boolean ignoreFutureMigrations ;
73+ private final boolean validateMigrationNaming ;
7074 private final boolean validateOnMigrate ;
7175 private final boolean cleanOnValidationError ;
7276 private final boolean cleanDisabled ;
7377 private final boolean allowMixedMigrations ;
78+ private final boolean createSchemas ;
7479 private final boolean mixed ;
7580 private final boolean group ;
7681 private final String installedBy ;
@@ -79,6 +84,7 @@ public class FlywayConfigSnapshot {
7984 private final boolean batch ;
8085 private final boolean oracleSqlPlus ;
8186 private final boolean oracleSqlplusWarn ;
87+ private final boolean outputQueryResults ;
8288 private final int connectRetries ;
8389
8490 public FlywayConfigSnapshot (Flyway flyway ) {
@@ -226,8 +232,32 @@ public FlywayConfigSnapshot(Flyway flyway) {
226232
227233 if (flywayVersion >= 60 && isFlywayPro ) {
228234 this .oracleSqlplusWarn = getValue (config , "isOracleSqlplusWarn" );
235+ this .outputQueryResults = getValue (config , "outputQueryResults" );
229236 } else {
230237 this .oracleSqlplusWarn = false ;
238+ this .outputQueryResults = true ;
239+ }
240+
241+ if (flywayVersion >= 61 ) {
242+ this .defaultSchemaName = getValue (config , "getDefaultSchema" );
243+ } else {
244+ this .defaultSchemaName = null ;
245+ }
246+
247+ if (flywayVersion >= 62 ) {
248+ this .validateMigrationNaming = getValue (config , "isValidateMigrationNaming" );
249+ } else {
250+ this .validateMigrationNaming = false ;
251+ }
252+
253+ if (flywayVersion >= 65 ) {
254+ this .resourceProvider = getValue (config , "getResourceProvider" );
255+ this .javaMigrationClassProvider = getValue (config , "getJavaMigrationClassProvider" );
256+ this .createSchemas = getValue (config , "getCreateSchemas" );
257+ } else {
258+ this .resourceProvider = null ;
259+ this .javaMigrationClassProvider = null ;
260+ this .createSchemas = true ;
231261 }
232262 }
233263
@@ -263,6 +293,14 @@ public List<MigrationResolver> getResolvers() {
263293 return resolvers ;
264294 }
265295
296+ public Object getResourceProvider () {
297+ return resourceProvider ;
298+ }
299+
300+ public Object getJavaMigrationClassProvider () {
301+ return javaMigrationClassProvider ;
302+ }
303+
266304 public boolean isSkipDefaultResolvers () {
267305 return skipDefaultResolvers ;
268306 }
@@ -327,6 +365,10 @@ public String getTablespace() {
327365 return tablespace ;
328366 }
329367
368+ public String getDefaultSchemaName () {
369+ return defaultSchemaName ;
370+ }
371+
330372 public List <String > getSchemas () {
331373 return schemas ;
332374 }
@@ -371,6 +413,10 @@ public boolean isIgnoreFutureMigrations() {
371413 return ignoreFutureMigrations ;
372414 }
373415
416+ public boolean isValidateMigrationNaming () {
417+ return validateMigrationNaming ;
418+ }
419+
374420 public boolean isValidateOnMigrate () {
375421 return validateOnMigrate ;
376422 }
@@ -387,6 +433,10 @@ public boolean isAllowMixedMigrations() {
387433 return allowMixedMigrations ;
388434 }
389435
436+ public boolean isCreateSchemas () {
437+ return createSchemas ;
438+ }
439+
390440 public boolean isMixed () {
391441 return mixed ;
392442 }
@@ -427,6 +477,10 @@ public boolean isOracleSqlplusWarn() {
427477 return oracleSqlplusWarn ;
428478 }
429479
480+ public boolean isOutputQueryResults () {
481+ return outputQueryResults ;
482+ }
483+
430484 public int getConnectRetries () {
431485 return connectRetries ;
432486 }
@@ -445,20 +499,25 @@ public boolean equals(Object o) {
445499 ignoreIgnoredMigrations == that .ignoreIgnoredMigrations &&
446500 ignorePendingMigrations == that .ignorePendingMigrations &&
447501 ignoreFutureMigrations == that .ignoreFutureMigrations &&
502+ validateMigrationNaming == that .validateMigrationNaming &&
448503 validateOnMigrate == that .validateOnMigrate &&
449504 cleanOnValidationError == that .cleanOnValidationError &&
450505 cleanDisabled == that .cleanDisabled &&
451506 allowMixedMigrations == that .allowMixedMigrations &&
507+ createSchemas == that .createSchemas &&
452508 mixed == that .mixed &&
453509 group == that .group &&
454510 dryRun == that .dryRun &&
455511 stream == that .stream &&
456512 batch == that .batch &&
457513 oracleSqlPlus == that .oracleSqlPlus &&
458514 oracleSqlplusWarn == that .oracleSqlplusWarn &&
515+ outputQueryResults == that .outputQueryResults &&
459516 connectRetries == that .connectRetries &&
460517 Objects .equals (resolvers , that .resolvers ) &&
461518 Objects .equals (errorHandlers , that .errorHandlers ) &&
519+ Objects .equals (resourceProvider , that .resourceProvider ) &&
520+ Objects .equals (javaMigrationClassProvider , that .javaMigrationClassProvider ) &&
462521 Objects .equals (baselineVersion , that .baselineVersion ) &&
463522 Objects .equals (target , that .target ) &&
464523 Objects .equals (locations , that .locations ) &&
@@ -469,6 +528,7 @@ public boolean equals(Object o) {
469528 Objects .equals (placeholders , that .placeholders ) &&
470529 Objects .equals (table , that .table ) &&
471530 Objects .equals (tablespace , that .tablespace ) &&
531+ Objects .equals (defaultSchemaName , that .defaultSchemaName ) &&
472532 Objects .equals (baselineDescription , that .baselineDescription ) &&
473533 Objects .equals (undoSqlMigrationPrefix , that .undoSqlMigrationPrefix ) &&
474534 Objects .equals (repeatableSqlMigrationPrefix , that .repeatableSqlMigrationPrefix ) &&
@@ -485,16 +545,17 @@ public boolean equals(Object o) {
485545 @ Override
486546 public int hashCode () {
487547 return Objects .hash (
488- resolvers , errorHandlers ,
548+ resolvers , errorHandlers , resourceProvider , javaMigrationClassProvider ,
489549 baselineVersion , target , locations , schemas , sqlMigrationSuffixes ,
490- javaMigrations , errorOverrides , placeholders , table , tablespace ,
550+ javaMigrations , errorOverrides , placeholders , table , tablespace , defaultSchemaName ,
491551 baselineDescription , undoSqlMigrationPrefix , repeatableSqlMigrationPrefix ,
492552 sqlMigrationSeparator , sqlMigrationPrefix , placeholderPrefix ,
493553 placeholderSuffix , encoding , initSql , licenseKey ,
494554 skipDefaultResolvers , skipDefaultCallbacks , placeholderReplacement , baselineOnMigrate ,
495555 outOfOrder , ignoreMissingMigrations , ignoreIgnoredMigrations , ignorePendingMigrations ,
496- ignoreFutureMigrations , validateOnMigrate , cleanOnValidationError , cleanDisabled ,
497- allowMixedMigrations , mixed , group , installedBy , dryRun , stream , batch ,
498- oracleSqlPlus , oracleSqlplusWarn , connectRetries );
556+ ignoreFutureMigrations , validateMigrationNaming , validateOnMigrate ,
557+ cleanOnValidationError , cleanDisabled , allowMixedMigrations , createSchemas ,
558+ mixed , group , installedBy , dryRun , stream , batch ,
559+ oracleSqlPlus , oracleSqlplusWarn , outputQueryResults , connectRetries );
499560 }
500561}
0 commit comments