gpt4 book ai didi

Grails 数据库迁移插件

转载 作者:行者123 更新时间:2023-12-02 14:26:42 24 4
gpt4 key购买 nike

我正在尝试更改我的数据库模型,所以我关注了 this教程。顺便说一句,我正在使用 Grails 1.3.7。

我跑了:

grails install-plugin database-migration

它安装得很好!

但是当我跑的时候:
dbm-generate-gorm-changelog changelog.groovy

它给了我以下错误:
java.io.FileNotFoundException: grails-app\migrations\changelog.groovy (The system cannot find the path specified)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:212)
at java.io.FileOutputStream.<init>(FileOutputStream.java:165)
at java.io.FileWriter.<init>(FileWriter.java:90)
at _DatabaseMigrationCommon_groovy$_run_closure7.doCall(_DatabaseMigrationCommon_groovy:128)
at _DatabaseMigrationCommon_groovy$_run_closure7.call(_DatabaseMigrationCommon_groovy)
at DbmGenerateGormChangelog$_run_closure1_closure2.doCall(DbmGenerateGormChangelog:28)
at DbmGenerateGormChangelog$_run_closure1_closure2.doCall(DbmGenerateGormChangelog)
at _DatabaseMigrationCommon_groovy$_run_closure6_closure18.doCall(_DatabaseMigrationCommon_groovy:88)
at _DatabaseMigrationCommon_groovy$_run_closure6_closure18.doCall(_DatabaseMigrationCommon_groovy)
at grails.plugin.databasemigration.MigrationUtils.executeInSession(MigrationUtils.groovy:99)
at grails.plugin.databasemigration.MigrationUtils$executeInSession.call(Unknown Source)
at _DatabaseMigrationCommon_groovy$_run_closure6.doCall(_DatabaseMigrationCommon_groovy:81)
at _DatabaseMigrationCommon_groovy$_run_closure6.call(_DatabaseMigrationCommon_groovy)
at DbmGenerateGormChangelog$_run_closure1.doCall(DbmGenerateGormChangelog:27)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)

最佳答案

您可能缺少“--add”:

dbm-generate-gorm-changelog --add changelog.groovy

Grails 数据库迁移的绝佳入口点(由 grails 团队提供): http://blog.springsource.org/2011/08/17/countdown-to-grails-2-0-database-migrations/

关于Grails 数据库迁移插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9792570/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com