+
+ <!-- Offer -->
+ <table name="Offer" phpName="Offer" baseClass="ReadifoodObject">
+ <vendor type="mysql">
+ <parameter name="Engine" value="InnoDB"/>
+ <parameter name="Charset" value="utf8"/>
+ </vendor>
+ <column name="id" type="integer" primaryKey="true" required="true" autoIncrement="true"/>
+ <column name="description" type="varchar" size="256" required="true"/>
+ <column name="valid_from" type="date"/>
+ <column name="valid_to" type="date"/>
+ </table>
+
+ <!-- Offer state -->
+ <table name="OfferState" phpName="OfferState" baseClass="ReadifoodObject">
+ <vendor type="mysql">
+ <parameter name="Engine" value="InnoDB"/>
+ <parameter name="Charset" value="utf8"/>
+ </vendor>
+ <column name="id" type="integer" required="true" primaryKey="true" autoIncrement="true"/>
+ <column name="updated" type="timestamp" required="true"/>
+ <column name="offer_id" type="integer" required="true"/>
+ <column name="user_id" type="integer" required="true"/>
+ <column name="contact_id" type="integer" required="true"/>
+ <column name="state" type="integer" required="true"/>
+ <foreign-key foreignTable="Offer" phpName="Offer" refPhpName="OfferState">
+ <reference local="offer_id" foreign="id"/>
+ </foreign-key>
+ <foreign-key foreignTable="User" phpName="User" refPhpName="OfferState">
+ <reference local="user_id" foreign="contact_id"/>
+ </foreign-key>
+ <foreign-key foreignTable="Contact" phpName="Contact" refPhpName="OfferState">
+ <reference local="contact_id" foreign="id"/>
+ </foreign-key>
+ </table>