I'm using per module Flyway database migration scripts.
@ModuleSlicing(extraIncludes = ['integrationtest', 'catalog'])
@DataJpaTest
@AutoConfigureTestDatabase(replace = NONE)
@TestPropertySource(properties = """
spring.jpa.show-sql=true
""")
class OrderRepositorySpec extends AbstractAggregateRootRepositorySpecification<Order, OrderIdentifier> {
@Autowired
OrderFactory entityFactory
@Autowired
OrderRepository repository
}
A db/migration/__root resource directory containes the script for adding the Spring modulith tables. However it is not executed when a test (database integration test) is executed.
Its the org.springframework.modulith.runtime.flyway.ActiveModules#shouldMigrate check that prevents that as its internal variable includedModules does not include the __root module.
However the __root migration is applied when the production code is run.
I'm using per module Flyway database migration scripts.
A
db/migration/__rootresource directory containes the script for adding the Spring modulith tables. However it is not executed when a test (database integration test) is executed.Its the
org.springframework.modulith.runtime.flyway.ActiveModules#shouldMigratecheck that prevents that as its internal variableincludedModulesdoes not include the__rootmodule.However the
__rootmigration is applied when the production code is run.