0

We would like to use SpringJdbcMigration to apply database changes but have a need to specify a different JDBCTemplate (for admin user) to the regular one (with a more restricted user).

We also want to grant privileges to the regular user but this varies between environments (developers assigned their own usernames, sysadmin assign different usernames for different environments) so need aceess to Spring's environment.getProperty("db.username").

It looks like Flyway does not support this level of integration with Spring - i.e. full bean configuration with dependency injections. Is there a way to provide an extension to Flyway to allow us to @Inject what we need?

user1016765
  • 2,935
  • 2
  • 32
  • 48

1 Answers1

0

While you can't @Inject, you can simply pass the user and password you want to Flyway itself. This will then be used for the connection being wrapped by the JdbcTemplate.

Axel Fontaine
  • 34,542
  • 16
  • 106
  • 137