Grails中的Liquibase:“空结果集,预计一行”

时间:2012-11-20 23:59:59

标签: database grails migration database-migration liquibase

我对Grails域类进行了更改并运行了

grails db-gorm-diff 2012-11-20-domain-class-change.groovy --add(显然还有另一个名字)

并且从Liquibase那里得到了“更改锁定”错误:

Error executing bootstraps: liquibase.exception.LockException: Could not acquire change log lock. Currently locked by computer-name.local […]

所以(愚蠢地,似乎)遵循an aged thread dealing with a similar problem with the Autobase plugin中的建议,我删除了更改日志锁定表中的行:

mysql> delete from DATABASECHANGELOGLOCK;

现在得到这个美丽的Liquibase错误:

Error executing bootstraps: liquibase.exception.DatabaseException: Empty result set, expected one row

这清楚地告诉我,为时已经太晚了,我不应该从表中删除那一行。

我现在该怎么办?

3 个答案:

答案 0 :(得分:4)

答案 1 :(得分:2)

我在一些与Liquibase相关的地方挖了一些,现在我知道我可以简单drop the table altogether并在启动时重新创建它。这似乎有效。

答案 2 :(得分:2)

看看http://forum.liquibase.org/topic/message-regarding-an-empty-result-set-for-databasechangeloglock。您只需将'locked'行设置为1或完全删除databasechangelock表(然后将重新创建)