简体   繁体   中英

propel DOMDocument::schemaValidate(): Element 'foreign-key', attribute 'ondelete','onupdate','skipsql' The attribute is not allowing?

I am using propel PHP: The foreign key attries are not getting depended on the parent table. The Creations, updates, deletes are taken place in parent is not effecting the child table.

foreign-key elements like onupdate,ondelete,skipsql is not acceping by the propel and error's like this

DOMDocument::schemaValidate(): Element 'foreign-key', attribute 'ondelete','onupdate','skipsql'

The attribute is not allowing?

I got it, it's syntax mistake in my xml file.

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM