Bru*_*ebs 5 grails groovy database-migration
我需要一些帮助。我已经按照文档所述配置了数据库迁移插件:
grails.plugin.databasemigration.updateOnStart = true
grails.plugin.databasemigration.updateOnStartFileNames = ['changelog.groovy']
Run Code Online (Sandbox Code Playgroud)
运行“grails run-app”时效果很好。我的数据库已按预期迁移,但是在部署“grails war”工件时如何获得此行为?
我已经在 tomcat 上测试了它,通过手动将工件复制到 tomcat/webapps 文件夹,但在部署过程中,hibernate 抱怨缺少列(应该由数据库迁移插件创建的列)。
有任何想法吗?
谢谢!
我相信如果您执行 dbm-update 会在目标数据库中为您创建补丁。
从 Grails 站点获取此内容。 http://grails-plugins.github.io/grails-database-migration/docs/manual/ref/Update%20Scripts/dbm-update.html
dbm-update 目的
将数据库更新到当前版本。
描述
运行变更日志中所有未运行的变更集。针对当前环境(默认为 dev)在 DataSource.groovy 中配置的数据库执行。
用法: