Code review comment: @mfpc Hi, have a look at https://github.com/quarkusio/quarkus/blob/main/extensions/agroal/runtime/src/main/java/io/quarkus/agroal/runtime/DataSources.java#L322 please, so there in addition to checking the username and password properties, an attempt is made to get  the username and password out of the credentials provider such as HashiCorp Vault for example. So if you add a code like ```  String beanName = flywayRuntimeConfig.credentialsProviderName.orElse(null);  CredentialsProvider credentialsProvider = CredentialsProviderFinder.find(beanName); ``` you can then get a Map of properties from this provider and check `USERNAME` and `PASSWORD` keys - if not null pass them to the flyway datasource config.  So if someone is using a credentials provider to configure access to for postgresql then it should be possible to use another credentials provider to configure this special flyway user as well. It is not a blocking comment/suggestion - can probably be done later but IMHO would make sense to get it done now if possible

Code under review:
public Flyway createFlyway(DataSource dataSource) {
        FluentConfiguration configure = Flyway.configure();

        if (flywayRuntimeConfig.jdbcUrl.isPresent()) {
            if (flywayRuntimeConfig.username.isPresent() && flywayRuntimeConfig.password.isPresent()) {
                configure.dataSource(flywayRuntimeConfig.jdbcUrl.get(), flywayRuntimeConfig.username.get(),
                        flywayRuntimeConfig.password.get());
            }
        } else {
            if (flywayRuntimeConfig.username.isPresent() && flywayRuntimeConfig.password.isPresent()) {
                configure.dataSource(
                        new CredentialsDataSource(dataSource, flywayRuntimeConfig.username.get(),
                                flywayRuntimeConfig.password.get()));
            } else {
                configure.dataSource(dataSource);
            }
        }
        if (flywayRuntimeConfig.initSql.isPresent()) {
            configure.initSql(flywayRuntimeConfig.initSql.get());
        }
        if (flywayRuntimeConfig.connectRetries.isPresent()) {
            configure.connectRetries(flywayRuntimeConfig.connectRetries.getAsInt());
        }
        if (flywayRuntimeConfig.defaultSchema.isPresent()) {
            configure.defaultSchema(flywayRuntimeConfig.defaultSchema.get());
        }
        if (flywayRuntimeConfig.schemas.isPresent()) {
            configure.schemas(flywayRuntimeConfig.schemas.get().toArray(EMPTY_ARRAY));
        }
        if (flywayRuntimeConfig.table.isPresent()) {
            configure.table(flywayRuntimeConfig.table.get());
        }
        configure.locations(flywayBuildTimeConfig.locations.toArray(EMPTY_ARRAY));
        if (flywayRuntimeConfig.sqlMigrationPrefix.isPresent()) {
            configure.sqlMigrationPrefix(flywayRuntimeConfig.sqlMigrationPrefix.get());
        }
        if (flywayRuntimeConfig.repeatableSqlMigrationPrefix.isPresent()) {
            configure.repeatableSqlMigrationPrefix(flywayRuntimeConfig.repeatableSqlMigrationPrefix.get());
        }
        configure.cleanDisabled(flywayRuntimeConfig.cleanDisabled);
        configure.baselineOnMigrate(flywayRuntimeConfig.baselineOnMigrate);
        configure.validateOnMigrate(flywayRuntimeConfig.validateOnMigrate);
        configure.validateMigrationNaming(flywayRuntimeConfig.validateMigrationNaming);

        final String[] ignoreMigrationPatterns;
        if (flywayRuntimeConfig.ignoreMigrationPatterns.isPresent()) {
            ignoreMigrationPatterns = flywayRuntimeConfig.ignoreMigrationPatterns.get();
        } else {
            List<String> patterns = new ArrayList<>(2);
            if (flywayRuntimeConfig.ignoreMissingMigrations) {
                patterns.add("*:Missing");
            }
            if (flywayRuntimeConfig.ignoreFutureMigrations) {
                patterns.add("*:Future");
            }
            
            ignoreMigrationPatterns = patterns.toArray(new String[0]);
        }

        configure.ignoreMigrationPatterns(ignoreMigrationPatterns);
        configure.cleanOnValidationError(flywayRuntimeConfig.cleanOnValidationError);
        configure.outOfOrder(flywayRuntimeConfig.outOfOrder);
        if (flywayRuntimeConfig.baselineVersion.isPresent()) {
            configure.baselineVersion(flywayRuntimeConfig.baselineVersion.get());
        }
        if (flywayRuntimeConfig.baselineDescription.isPresent()) {
            configure.baselineDescription(flywayRuntimeConfig.baselineDescription.get());
        }
        configure.placeholders(flywayRuntimeConfig.placeholders);
        configure.createSchemas(flywayRuntimeConfig.createSchemas);
        if (flywayRuntimeConfig.placeholderPrefix.isPresent()) {
            configure.placeholderPrefix(flywayRuntimeConfig.placeholderPrefix.get());
        }
        if (flywayRuntimeConfig.placeholderSuffix.isPresent()) {
            configure.placeholderSuffix(flywayRuntimeConfig.placeholderSuffix.get());
        }
        if (!callbacks.isEmpty()) {
            configure.callbacks(callbacks.toArray(new Callback[0]));
        }
        /*
         * Ensure that no classpath scanning takes place by setting the ClassProvider and the ResourceProvider
         * (see Flyway
         */

        
        QuarkusPathLocationScanner quarkusPathLocationScanner = new QuarkusPathLocationScanner(
                Arrays.asList(configure.getLocations()));
        configure.javaMigrationClassProvider(new QuarkusFlywayClassProvider<>(quarkusPathLocationScanner.scanForClasses()));
        configure.resourceProvider(new QuarkusFlywayResourceProvider(quarkusPathLocationScanner.scanForResources()));

        return configure.load();
    }

Line commented on: configure.sqlMigrationPrefix(flywayRuntimeConfig.sqlMigrationPrefix.get());

Revised code:
public Flyway createFlyway(DataSource dataSource) {
        FluentConfiguration configure = Flyway.configure();

        if (flywayRuntimeConfig.jdbcUrl.isPresent()) {
            if (flywayRuntimeConfig.username.isPresent() && flywayRuntimeConfig.password.isPresent()) {
                configure.dataSource(flywayRuntimeConfig.jdbcUrl.get(), flywayRuntimeConfig.username.get(),
                        flywayRuntimeConfig.password.get());
            } else {
                throw new ConfigurationException(
                        "Username and password must be defined when a JDBC URL is provided in the Flyway configuration");
            }
        } else {
            if (flywayRuntimeConfig.username.isPresent() && flywayRuntimeConfig.password.isPresent()) {
                AgroalDataSource agroalDataSource = (AgroalDataSource) dataSource;
                String jdbcUrl = agroalDataSource.getConfiguration().connectionPoolConfiguration()
                        .connectionFactoryConfiguration().jdbcUrl();

                configure.dataSource(jdbcUrl, flywayRuntimeConfig.username.get(),
                        flywayRuntimeConfig.password.get());
            } else {

                configure.dataSource(dataSource);
            }
        }
        if (flywayRuntimeConfig.initSql.isPresent()) {
            configure.initSql(flywayRuntimeConfig.initSql.get());
        }
        if (flywayRuntimeConfig.connectRetries.isPresent()) {
            configure.connectRetries(flywayRuntimeConfig.connectRetries.getAsInt());
        }
        if (flywayRuntimeConfig.defaultSchema.isPresent()) {
            configure.defaultSchema(flywayRuntimeConfig.defaultSchema.get());
        }
        if (flywayRuntimeConfig.schemas.isPresent()) {
            configure.schemas(flywayRuntimeConfig.schemas.get().toArray(EMPTY_ARRAY));
        }
        if (flywayRuntimeConfig.table.isPresent()) {
            configure.table(flywayRuntimeConfig.table.get());
        }
        configure.locations(flywayBuildTimeConfig.locations.toArray(EMPTY_ARRAY));
        if (flywayRuntimeConfig.sqlMigrationPrefix.isPresent()) {
            configure.sqlMigrationPrefix(flywayRuntimeConfig.sqlMigrationPrefix.get());
        }
        if (flywayRuntimeConfig.repeatableSqlMigrationPrefix.isPresent()) {
            configure.repeatableSqlMigrationPrefix(flywayRuntimeConfig.repeatableSqlMigrationPrefix.get());
        }
        configure.cleanDisabled(flywayRuntimeConfig.cleanDisabled);
        configure.baselineOnMigrate(flywayRuntimeConfig.baselineOnMigrate);
        configure.validateOnMigrate(flywayRuntimeConfig.validateOnMigrate);
        configure.validateMigrationNaming(flywayRuntimeConfig.validateMigrationNaming);

        final String[] ignoreMigrationPatterns;
        if (flywayRuntimeConfig.ignoreMigrationPatterns.isPresent()) {
            ignoreMigrationPatterns = flywayRuntimeConfig.ignoreMigrationPatterns.get();
        } else {
            List<String> patterns = new ArrayList<>(2);
            if (flywayRuntimeConfig.ignoreMissingMigrations) {
                patterns.add("*:Missing");
            }
            if (flywayRuntimeConfig.ignoreFutureMigrations) {
                patterns.add("*:Future");
            }
            
            ignoreMigrationPatterns = patterns.toArray(new String[0]);
        }

        configure.ignoreMigrationPatterns(ignoreMigrationPatterns);
        configure.cleanOnValidationError(flywayRuntimeConfig.cleanOnValidationError);
        configure.outOfOrder(flywayRuntimeConfig.outOfOrder);
        if (flywayRuntimeConfig.baselineVersion.isPresent()) {
            configure.baselineVersion(flywayRuntimeConfig.baselineVersion.get());
        }
        if (flywayRuntimeConfig.baselineDescription.isPresent()) {
            configure.baselineDescription(flywayRuntimeConfig.baselineDescription.get());
        }
        configure.placeholders(flywayRuntimeConfig.placeholders);
        configure.createSchemas(flywayRuntimeConfig.createSchemas);
        if (flywayRuntimeConfig.placeholderPrefix.isPresent()) {
            configure.placeholderPrefix(flywayRuntimeConfig.placeholderPrefix.get());
        }
        if (flywayRuntimeConfig.placeholderSuffix.isPresent()) {
            configure.placeholderSuffix(flywayRuntimeConfig.placeholderSuffix.get());
        }
        if (!callbacks.isEmpty()) {
            configure.callbacks(callbacks.toArray(new Callback[0]));
        }
        /*
         * Ensure that no classpath scanning takes place by setting the ClassProvider and the ResourceProvider
         * (see Flyway
         */

        
        QuarkusPathLocationScanner quarkusPathLocationScanner = new QuarkusPathLocationScanner(
                Arrays.asList(configure.getLocations()));
        configure.javaMigrationClassProvider(new QuarkusFlywayClassProvider<>(quarkusPathLocationScanner.scanForClasses()));
        configure.resourceProvider(new QuarkusFlywayResourceProvider(quarkusPathLocationScanner.scanForResources()));

        for (FlywayConfigurationCustomizer customizer : customizers) {
            customizer.customize(configure);
        }

        return configure.load();
    }