Propel - crossref表中第三个表的多个外键

时间:2015-08-06 07:20:13

标签: propel

在我的模式中,我有一个模型Person和一个模型项目多对多由一个名为ProjectView的交叉引用表相关联。每个ProjectView都与两个Transactions,AuthorTransaction和ViewerTransaction相关。

Person ========== ProjectView ============== Model
                   ||      ||
                   ||      ||
                   ||      ||
                  Transaction

我制作了以下架构:

<table name="Project_View" isCrossRef="true">
    <column name="project_id"
        primaryKey="true"
        type="BIGINT"
        phpType="int"/>
    <foreign-key foreignTable="Project"
        phpName="ViewedProject"
        onDelete="cascade"
        onUpdate="cascade">
        <reference local="project_id" foreign="id"/>
    </foreign-key>
    <column name="viewer_id" primaryKey="true" type="BIGINT" phpType="int"/>
    <foreign-key foreignTable="Person"
        phpName="Viewer"
        onDelete="cascade"
        onUpdate="cascade">
        <reference local="viewer_id" foreign="id"/>
    </foreign-key>
    <column name="viewer_transaction_id" type="BIGINT" phpType="int"/>
    <foreign-key foreignTable="Transaction"
        phpName="ViewerTransaction"
        onDelete="restrict"
        onUpdate="restrict">
        <reference local="viewer_transaction_id" foreign="id"/>
    </foreign-key>
    <column name="author_transaction_id" type="BIGINT" phpType="int"/>
    <foreign-key foreignTable="Transaction"
        phpName="AuthorTransaction"
        onDelete="restrict"
        onUpdate="restrict">
        <reference local="author_transaction_id" foreign="id"/>
    </foreign-key>
</table>

但是,生成的Transaction类内部有重复的名称,导致模型无法使用。这在Propel 2.0中是否不受支持?

0 个答案:

没有答案