我正在使用推动PHP:外键不能依赖于父表。在父级中进行的创建,更新,删除不影响子表。
像onupdate,ondelete,skipsql这样的外键元素不会被推进和错误加入
DOMDocument :: schemaValidate():元素'foreign-key',属性'ondelete','onupdate','skipsql'
该属性不允许?
答案 0 :(得分:0)
我明白了,我的xml文件中存在语法错误。
<table name="names" phpName="Name">
<column name="nameid" phpName="Nid" type="integer" size="11" required="true" primaryKey="true"
autoIncrement="true" description="Name ID"/>
<column name="name" phpName="Name" type="varchar" size="50" required="true"
description="Name"/>
<validator column="name">
<rule name="required" message="Name is Required"/>
<rule name="minLength" value="3" message="Enter Valid Full-Name, Minimum of 3 characters"/>
<rule name="maxLength" value="20" message="Invalid Entry"/>
<rule name="match" value="/^[\w]+$/" message="No Special Character Allowed"/>
<rule name="unique" />
</validator>
</table>
<table name="relations" phpName="Relations">
<column name="rid" type="integer" size="11" required="true" primaryKey="true" autoIncrement="true"
description="Relational ID"/>
<column name="pnid" type="integer" size="11" required="true" description="name User ID"/>
<column name="rnid" type="integer" size="11" required="true" description="name Relationship ID"/>
<column name="relation" type="varchar" size="100" required="true" description="Relationship"/>
<validator column="relation">
<rule name="required" message="Relationship Type is Required" />
<rule name="match" value="/^([\w])+([\.\w\-]+)+$/" message="Enter a Valid String" />
<rule name="minLength" value="3" message="Enter a Valid Relation Ship"/>
<rule name="maxLength" value="20" message="Invalid Entry"/>
</validator>
<foreign-key foreignTable="names" onUpdate="CASCADE" onDelete="CASCADE">
<reference local="pnid" foreign="nid" />
<reference local="rnid" foreign="nid" />
</foreign-key>
</table>