我對propel中的外鍵有疑問。 我有我的項目2點的模式相匹配2個物理數據庫即: 我的地方一(DB一),並與一些一 遠程數據庫的只讀信息(DB二)使用Propel的遠程數據庫的外鍵
的一點是,我需要設置從DB One到DB Two的外鍵,但它不起作用。 這裏是我的架構:
模式1
<database package="dbOne" defaultIdMethod="native" name="dbOne">
<table name="tableOne">
<column name="pk_tableOne" type="INTEGER" primaryKey="true" required="true" autoIncrement="true"/>
<column name="column_one" type="DOUBLE" required="true"/>
<foreign-key name="fk_column_one" foreignTable="tableTwo" foreignSchema = "dbTwo">
<reference local="column_one" foreign="column_two"/>
</foreign-key>
</table>
</database>
模式2
<database package="dbTwo" defaultIdMethod="native" name="dbTwo">
<table name="tableTwo">
<column name="column_two" type="DOUBLE" primaryKey="true" required="true"/>
</database>
我已經OM/diff命令我得到的過程中設置兩種運行時/建造-conf.xml中與兩個數據源,此錯誤:
Execution of target "om-template" failed for the following reason: "tableOne" contains a foreign key to nonexistent table "dbTwo.tableTwo"
我在做什麼錯?
您是否嘗試刪除每個數據庫節點的'package'屬性? – j0k
是的,它返回相同的錯誤 – user2038988