英文:
how to run flyway operations in tomcat
问题
因为升级,我必须更新迁移文件以使它们与新版本兼容。这导致哈希不匹配,应用程序无法启动。在本地,我可以通过运行以下命令来修复:
mvn flyway:repair
然而,在服务器上,应用程序在Tomcat中运行,所以我无法执行这些Maven目标。
在Tomcat中运行的应用程序中执行Flyway修复的另一种方法吗?
英文:
I have a spring boot application. Because of an upgrade I must update the migration files to make them compatible to the new version. This leads to hash mismatch and the application does not start. Locally I can fix it by running
mvn flyway:repair
However, in the servers the applications run in a tomcat, so I cannot execute those maven targets.
Is there another way to execute the flyway repair in an application running in tomcat?
答案1
得分: 1
一个类似的问题在这里得到了解答。https://stackoverflow.com/a/38577633/16398766
简而言之,你可以在Spring中创建一个FlywayMigrationStrategy
bean,在运行你的迁移之前执行flyway.repair()
方法。
英文:
A similar question was answered here. https://stackoverflow.com/a/38577633/16398766
In short though, you create a FlywayMigrationStrategy
bean in Spring to run the flyway.repair()
method before your migrations.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论