update thelia model

This commit is contained in:
Manuel Raynaud
2013-07-29 14:08:09 +02:00
parent dc73e34f0f
commit b0622c1fae
30 changed files with 5477 additions and 2508 deletions

View File

@@ -9,7 +9,6 @@
<column name="description" type="CLOB" />
<column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" />
<behavior name="timestampable" />
<behavior name="i18n">
<parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
</behavior>
@@ -17,19 +16,13 @@
<parameter name="log_created_at" value="true" />
<parameter name="log_created_by" value="true" />
</behavior>
<behavior name="timestampable" />
</table>
<table name="product" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="tax_rule_id" type="INTEGER" />
<column name="ref" required="true" size="255" type="VARCHAR" />
<column name="price" required="true" type="FLOAT" />
<column name="price2" type="FLOAT" />
<column name="ecotax" type="FLOAT" />
<column defaultValue="0" name="newness" type="TINYINT" />
<column defaultValue="0" name="promo" type="TINYINT" />
<column defaultValue="0" name="quantity" type="INTEGER" />
<column defaultValue="0" name="visible" required="true" type="TINYINT" />
<column name="weight" type="FLOAT" />
<column name="position" required="true" type="INTEGER" />
<column name="title" size="255" type="VARCHAR" />
<column name="description" type="CLOB" />
@@ -242,24 +235,18 @@
<parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
</behavior>
</table>
<table name="combination" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="ref" size="255" type="VARCHAR" />
<behavior name="timestampable" />
</table>
<table name="attribute_combination" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="attribute_id" primaryKey="true" required="true" type="INTEGER" />
<column name="combination_id" primaryKey="true" required="true" type="INTEGER" />
<column name="attribute_av_id" primaryKey="true" required="true" type="INTEGER" />
<column name="stock_id" primaryKey="true" required="true" type="INTEGER" />
<foreign-key foreignTable="attribute" name="fk_ attribute_combination_attribute_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="attribute_id" />
</foreign-key>
<foreign-key foreignTable="attribute_av" name="fk_ attribute_combination_attribute_av_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="attribute_av_id" />
</foreign-key>
<foreign-key foreignTable="combination" name="fk_ attribute_combination_combination_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="combination_id" />
<foreign-key foreignTable="stock" name="fk_attribute_combination_stock_id">
<reference foreign="id" local="stock_id" />
</foreign-key>
<index name="idx_ attribute_combination_attribute_id">
<index-column name="attribute_id" />
@@ -267,8 +254,8 @@
<index name="idx_ attribute_combination_attribute_av_id">
<index-column name="attribute_av_id" />
</index>
<index name="idx_ attribute_combination_combination_id">
<index-column name="combination_id" />
<index name="idx_attribute_combination_stock_id">
<index-column name="stock_id" />
</index>
<behavior name="timestampable" />
</table>
@@ -278,15 +265,12 @@
<column name="product_id" required="true" type="INTEGER" />
<column name="increase" type="FLOAT" />
<column name="quantity" required="true" type="FLOAT" />
<foreign-key foreignTable="combination" name="fk_stock_combination_id" onDelete="SET NULL" onUpdate="RESTRICT">
<reference foreign="id" local="combination_id" />
</foreign-key>
<column defaultValue="0" name="promo" type="TINYINT" />
<column defaultValue="0" name="newness" type="TINYINT" />
<column name="weight" type="FLOAT" />
<foreign-key foreignTable="product" name="fk_stock_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
<reference foreign="id" local="product_id" />
</foreign-key>
<index name="idx_stock_combination_id">
<index-column name="combination_id" />
</index>
<index name="idx_stock_product_id">
<index-column name="product_id" />
</index>
@@ -977,15 +961,15 @@
<column name="cart_id" required="true" type="INTEGER" />
<column name="product_id" required="true" type="INTEGER" />
<column defaultValue="1" name="quantity" type="FLOAT" />
<column name="combination_id" type="INTEGER" />
<column name="stock_id" required="true" type="INTEGER" />
<foreign-key foreignTable="cart" name="fk_cart_item_cart_id">
<reference foreign="id" local="cart_id" />
</foreign-key>
<foreign-key foreignTable="product" name="fk_cart_item_product_id">
<reference foreign="id" local="product_id" />
</foreign-key>
<foreign-key foreignTable="combination" name="fk_cart_item_combination_id">
<reference foreign="id" local="combination_id" />
<foreign-key foreignTable="stock" name="fk_cart_item_stock_id">
<reference foreign="id" local="stock_id" />
</foreign-key>
<index name="idx_cart_item_cart_id">
<index-column name="cart_id" />
@@ -993,8 +977,28 @@
<index name="idx_cart_item_product_id">
<index-column name="product_id" />
</index>
<index name="idx_cart_item_combination_id">
<index-column name="combination_id" />
<index name="idx_cart_item_stock_id">
<index-column name="stock_id" />
</index>
<behavior name="timestampable" />
</table>
<table name="product_price" namespace="Thelia\Model">
<column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
<column name="stock_id" required="true" type="INTEGER" />
<column name="currency_id" required="true" type="INTEGER" />
<column name="price" required="true" type="FLOAT" />
<column name="promo_price" type="FLOAT" />
<foreign-key foreignTable="stock" name="fk_product_price_stock_id">
<reference foreign="id" local="stock_id" />
</foreign-key>
<foreign-key foreignTable="currency" name="fk_product_price_currency_id">
<reference foreign="id" local="currency_id" />
</foreign-key>
<index name="idx_product_price_stock_id">
<index-column name="stock_id" />
</index>
<index name="idx_product_price_currency_id">
<index-column name="currency_id" />
</index>
<behavior name="timestampable" />
</table>