Generate "src/main/resources/db/migration" structure for Flyway projects
See original GitHub issueOut-of-the-box, the ApplicationTests.contextLoads()
test will fail with a generated project that uses Flyway because there’s no default migration file.
Adding an empty V1__init.sql
file into the resources/db/migration
directory would make that test pass and be a nicer experience.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Generate "src/main/resources/db/migration" structure ... - GitHub
contextLoads() test will fail with a generated project that uses Flyway because there's no default migration file.
Read more >Organising your Migrations - Flyway
Wildcards in practice. Release folder based structure. A common working pattern we have seen is to structure your migrations into 'releases'.
Read more >Creating a new project - Flyway - Product Documentation
A project in Flyway Desktop allows you to track changes to a development database and generate migration scripts that can be versioned ...
Read more >Database Migrations with Flyway - Baeldung
To generate a differential versioned migration, simply install the plugin and call the action from the JPA Structure panel. We simply select ...
Read more >Database migration with Flyway in large project | Novatec
The following diagram illustrates the scripts in different increment. ... When a sprint ends, our jenkins release build packs the Flyway ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That sounds reasonable to me. On the Boot side, perhaps we should consider some failure analysis for the exception that Flyway throws as well?
So it looks like Boot is the one complaining as part of autoconfigure (see https://github.com/spring-projects/spring-boot/blob/2.1.x/spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java#L191)
For adding Flyway to an existing Boot project that already has database schemas, etc., that check makes sense, but for a newly generated project, it’s confusing (“how can I write a migration when I don’t have any code yet?”). I feel like there needs to be better guidance, though I agree that generating an empty migration, which then has to be modified or thrown away, might not be best.