Skip to content

Commit

Permalink
Introduce validateMigrationNaming
Browse files Browse the repository at this point in the history
  • Loading branch information
gastaldi committed Aug 2, 2022
1 parent c34dc15 commit 693b339
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public Flyway createFlyway(DataSource dataSource) {
configure.cleanDisabled(flywayRuntimeConfig.cleanDisabled);
configure.baselineOnMigrate(flywayRuntimeConfig.baselineOnMigrate);
configure.validateOnMigrate(flywayRuntimeConfig.validateOnMigrate);
configure.validateMigrationNaming(true);
configure.validateMigrationNaming(flywayRuntimeConfig.validateMigrationNaming);
List<String> patterns = new ArrayList<>(2);
//https://flywaydb.org/documentation/configuration/parameters/ignoreMigrationPatterns
if (flywayRuntimeConfig.ignoreMissingMigrations) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,4 +180,11 @@ public static final FlywayDataSourceRuntimeConfig defaultConfig() {
*/
@ConfigItem
public Optional<String> initSql = Optional.empty();

/**
* Whether to validate migrations and callbacks whose scripts do not obey the correct naming convention. A failure can be
* useful to check that errors such as case sensitivity in migration prefixes have been corrected.
*/
@ConfigItem
public boolean validateMigrationNaming;
}

0 comments on commit 693b339

Please sign in to comment.