标题基本上总结了它。由于外键约束问题,Haven无法从2.0.5升级到3.x.
父表位于父模式中,并且有多个子模式,其表具有父模式的FK。表。子方案没有父表。很简单。变更集是:
<addForeignKeyConstraint baseColumnNames = "AUTHORITY" baseTableName = "GROUP_AUTHORITIES"
baseTableSchemaName = "FOO1"
constraintName = "FOO1_AUTHORITY_FK" deferrable = "false"
initiallyDeferred = "false" onDelete = "NO ACTION" onUpdate = "NO ACTION"
referencedColumnNames = "AUTHORITY" referencedTableName = "AUTHORITIES"
referencedTableSchemaName = "FOO"
referencesUniqueColumn = "true"/>
但是当创建alter语句时,它具有基表的模式,但不是所显示的引用表。
ALTER TABLE FOO1.GROUP_AUTHORITIES ADD CONSTRAINT FOO1_AUTHORITY_FK FOREIGN_KEY (AUTHORITY) REFERENCES AUTHORITIES (AUTHORITY) ON NO ACTION ON DELETE NO ACTION
alter语句中的referencedTableSchemaName发生了什么变化?我很惊讶没有其他人遇到这个,但我只是尝试再次更新到3.2并且仍然发生了关于无法添加外键约束的相同DatabaseException。