Now I have a spring-boot app which uses MsSQL server. And we use flyway for migrations.
I want to add an additional profile for tests. I want to generate tables from entity classes instead of using flyway.
I tried smth to write like this in application.yaml
spring: profiles: test jpa: generate-ddl: true hibernate: datasource: url: jdbc:h2:mem:test_db;MODE=MSSQLServer username: sa password:
but flyway starts anyway
Flyway is a tool that lets you version control incremental changes to your database so that you can migrate it to a new version easily and confidently. In this article, you'll learn how to use Flyway in Spring Boot applications to manage changes to your database.
FYI, for anybody who comes here looking for this, the property name has changed for Spring Boot 2.0:
For application.properties
format:
spring.flyway.enabled=false
For application.yml
format:
spring: flyway: enabled: false
Update: To disable flyway in a specific profile, you can put that property in the properties file specific to that profile. For instance, if your profile is called "abc", you can put it in application-abc.properties
. Check out Spring's documentation on Profile-specific properties for more clarity on how to name the files. Generally, the format is application-{profileName}.properties
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With