'Filtering Flyway migrations

I am using Flyway core 8.0.5 and I am configuring it like this:

 FluentConfiguration fluentConfiguration = Flyway.configure()
                .dataSource(getDataSource())
                .locations(Optional.ofNullable(scriptsMap.get(getDbVendor())).orElseThrow(() -> new IllegalStateException("Unrecognized case: " + getDbVendor())))
                .encoding("UTF-8");

And now I want to have two modes - execute all scripts from given locations - that is ready above, and the second mode would be same but I want to filter Flyway migrations and execute only those that has DDL in script name, for example script_1_DDL.sql

Is it possible and how ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source