Support for application-module-specific database migrations #1067
Labels
in: runtime
General runtime support
in: test support
Spring Boot integration testing
type: enhancement
Major enhanvements, new features
Database migrations are usually run per application. In a modulith application, though, it makes sense to organize them by modules. Some migration tools allow organizing the files in folders but still ultimately order by the order naming scheme across all files found independent of the location:
In integration tests for a particular module, this would already allow only executing the migrations for
order
for example. However, this would mean that the migrations might run in a different order in production, which might cause subtle problems. The reason for that is that, for example, Flyway calculates the overall order of execution across all files.In a modulithic arrangement, however, the modular structure and dependency graph between the modules should guide the overall execution order. This can be mitigated by a versioning scheme that follows the dependency structure, but that again is error prone. We should provide Boot extensions that execute migrations in the order of the dependency graph:
Related tickets
ApplicationModules
instance to executeApplicationModuleInitializer
s #1065ApplicationModuleIdentifiers
in order of module dependency #1066The text was updated successfully, but these errors were encountered: