且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Spring Boot应用程序中使用Flyway时,如何在H2中加载初始数据?

更新时间:2021-11-12 03:13:46

Per documentation , a profile-specific customised flyway spring.flyway.locations can be configured. The profile-specific scripts runs when that profile is active . So a dev profile configured will work on this requirement.

初始化脚本可以作为迁移文件夹的一部分放置,该文件夹将运行并填充数据库.

The initialisation script can be placed as part of migration folder which will run and populate the db.

可以找到一个示例 查看全文