<?xml version="1.0" encoding="UTF-8"?>
<database defaultIdMethod="native" name="thelia" namespace="Thelia\Model">
  <table name="category">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="parent" type="INTEGER" />
    <column name="link" size="255" type="VARCHAR" />
    <column name="visible" required="true" type="TINYINT" />
    <column name="position" required="true" type="INTEGER" />
    <column name="title" size="255" type="VARCHAR" />
    <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>
    <behavior name="versionable">
      <parameter name="log_created_at" value="true" />
      <parameter name="log_created_by" value="true" />
    </behavior>
  </table>
  <table name="product">
    <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="stock" 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" />
    <column name="chapo" type="LONGVARCHAR" />
    <column name="postscriptum" type="LONGVARCHAR" />
    <foreign-key foreignTable="tax_rule" name="fk_product_tax_rule_id" onDelete="SET NULL" onUpdate="RESTRICT">
      <reference foreign="id" local="tax_rule_id" />
    </foreign-key>
    <unique name="ref_UNIQUE">
      <unique-column name="ref" />
    </unique>
    <index name="idx_product_tax_rule_id">
      <index-column name="tax_rule_id" />
    </index>
    <behavior name="timestampable" />
    <behavior name="i18n">
      <parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
    </behavior>
    <behavior name="versionable">
      <parameter name="log_created_at" value="true" />
      <parameter name="log_created_by" value="true" />
    </behavior>
  </table>
  <table name="product_category">
    <column name="product_id" primaryKey="true" required="true" type="INTEGER" />
    <column name="category_id" primaryKey="true" required="true" type="INTEGER" />
    <foreign-key foreignTable="product" name="fk_product_has_category_product1" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="product_id" />
    </foreign-key>
    <foreign-key foreignTable="category" name="fk_product_has_category_category1" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="category_id" />
    </foreign-key>
    <index name="fk_product_has_category_category1_idx">
      <index-column name="category_id" />
    </index>
    <index name="fk_product_has_category_product1_idx">
      <index-column name="product_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="country">
    <column name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="area_id" type="INTEGER" />
    <column name="isocode" required="true" size="4" type="VARCHAR" />
    <column name="isoalpha2" size="2" type="VARCHAR" />
    <column name="isoalpha3" size="4" type="VARCHAR" />
    <column name="title" size="255" type="VARCHAR" />
    <column name="description" type="CLOB" />
    <column name="chapo" type="LONGVARCHAR" />
    <column name="postscriptum" type="LONGVARCHAR" />
    <foreign-key foreignTable="area" name="fk_country_area_id" onDelete="SET NULL" onUpdate="RESTRICT">
      <reference foreign="id" local="area_id" />
    </foreign-key>
    <index name="idx_country_area_id">
      <index-column name="area_id" />
    </index>
    <behavior name="timestampable" />
    <behavior name="i18n">
      <parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
    </behavior>
  </table>
  <table name="tax">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="rate" required="true" type="FLOAT" />
    <column name="title" size="255" type="VARCHAR" />
    <column name="description" type="LONGVARCHAR" />
    <behavior name="timestampable" />
    <behavior name="i18n">
      <parameter name="i18n_columns" value="title, description" />
    </behavior>
  </table>
  <table name="tax_rule">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="code" size="45" type="VARCHAR" />
    <column name="title" size="255" type="VARCHAR" />
    <column name="description" type="LONGVARCHAR" />
    <behavior name="timestampable" />
    <behavior name="i18n" />
  </table>
  <table name="tax_rule_country">
    <column name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="tax_rule_id" type="INTEGER" />
    <column name="country_id" type="INTEGER" />
    <column name="tax_id" type="INTEGER" />
    <column name="none" type="TINYINT" />
    <foreign-key foreignTable="tax" name="fk_tax_rule_country_tax_id" onDelete="SET NULL" onUpdate="RESTRICT">
      <reference foreign="id" local="tax_id" />
    </foreign-key>
    <foreign-key foreignTable="tax_rule" name="fk_tax_rule_country_tax_rule_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="tax_rule_id" />
    </foreign-key>
    <foreign-key foreignTable="country" name="fk_tax_rule_country_country_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="country_id" />
    </foreign-key>
    <index name="idx_tax_rule_country_tax_id">
      <index-column name="tax_id" />
    </index>
    <index name="idx_tax_rule_country_tax_rule_id">
      <index-column name="tax_rule_id" />
    </index>
    <index name="idx_tax_rule_country_country_id">
      <index-column name="country_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="feature">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column defaultValue="0" name="visible" type="INTEGER" />
    <column name="position" required="true" type="INTEGER" />
    <column name="title" size="255" type="VARCHAR" />
    <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>
  </table>
  <table name="feature_av">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="feature_id" required="true" type="INTEGER" />
    <column name="title" size="255" type="VARCHAR" />
    <column name="description" type="CLOB" />
    <column name="chapo" type="LONGVARCHAR" />
    <column name="postscriptum" type="LONGVARCHAR" />
    <foreign-key foreignTable="feature" name="fk_feature_av_feature_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="feature_id" />
    </foreign-key>
    <index name="idx_feature_av_feature_id">
      <index-column name="feature_id" />
    </index>
    <behavior name="timestampable" />
    <behavior name="i18n">
      <parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
    </behavior>
  </table>
  <table name="feature_prod">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="product_id" required="true" type="INTEGER" />
    <column name="feature_id" required="true" type="INTEGER" />
    <column name="feature_av_id" type="INTEGER" />
    <column name="by_default" size="255" type="VARCHAR" />
    <column name="position" type="INTEGER" />
    <foreign-key foreignTable="product" name="fk_feature_prod_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="product_id" />
    </foreign-key>
    <foreign-key foreignTable="feature" name="fk_feature_prod_feature_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="feature_id" />
    </foreign-key>
    <foreign-key foreignTable="feature_av" name="fk_feature_prod_feature_av_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="feature_av_id" />
    </foreign-key>
    <index name="idx_feature_prod_product_id">
      <index-column name="product_id" />
    </index>
    <index name="idx_feature_prod_feature_id">
      <index-column name="feature_id" />
    </index>
    <index name="idx_feature_prod_feature_av_id">
      <index-column name="feature_av_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="feature_category">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="feature_id" required="true" type="INTEGER" />
    <column name="category_id" required="true" type="INTEGER" />
    <foreign-key foreignTable="category" name="fk_feature_category_category_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="category_id" />
    </foreign-key>
    <foreign-key foreignTable="feature" name="fk_feature_category_feature_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="feature_id" />
    </foreign-key>
    <index name="idx_feature_category_category_id">
      <index-column name="category_id" />
    </index>
    <index name="idx_feature_category_feature_id">
      <index-column name="feature_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="attribute">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="position" type="INTEGER" />
    <column name="title" size="255" type="VARCHAR" />
    <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>
  </table>
  <table name="attribute_av">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="attribute_id" required="true" type="INTEGER" />
    <column name="position" required="true" type="INTEGER" />
    <column name="title" size="255" type="VARCHAR" />
    <column name="description" type="CLOB" />
    <column name="chapo" type="LONGVARCHAR" />
    <column name="postscriptum" type="LONGVARCHAR" />
    <foreign-key foreignTable="attribute" name="fk_attribute_av_attribute_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="attribute_id" />
    </foreign-key>
    <index name="idx_attribute_av_attribute_id">
      <index-column name="attribute_id" />
    </index>
    <behavior name="timestampable" />
    <behavior name="i18n">
      <parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
    </behavior>
  </table>
  <table name="combination">
    <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">
    <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" />
    <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>
    <index name="idx_ attribute_combination_attribute_id">
      <index-column name="attribute_id" />
    </index>
    <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>
    <behavior name="timestampable" />
  </table>
  <table name="stock">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="combination_id" type="INTEGER" />
    <column name="product_id" required="true" type="INTEGER" />
    <column name="increase" type="FLOAT" />
    <column name="value" 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>
    <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>
    <behavior name="timestampable" />
  </table>
  <table name="attribute_category">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="category_id" required="true" type="INTEGER" />
    <column name="attribute_id" required="true" type="INTEGER" />
    <foreign-key foreignTable="category" name="fk_attribute_category_category_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="category_id" />
    </foreign-key>
    <foreign-key foreignTable="attribute" name="fk_attribute_category_attribute_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="attribute_id" />
    </foreign-key>
    <index name="idx_attribute_category_category_id">
      <index-column name="category_id" />
    </index>
    <index name="idx_attribute_category_attribute_id">
      <index-column name="attribute_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="config">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="name" required="true" size="255" type="VARCHAR" />
    <column name="value" required="true" size="255" type="VARCHAR" />
    <column defaultValue="1" name="secured" required="true" type="TINYINT" />
    <column defaultValue="1" name="hidden" required="true" type="TINYINT" />
    <column name="title" size="255" type="VARCHAR" />
    <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>
  </table>
  <table name="customer">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="ref" required="true" size="50" type="VARCHAR" />
    <column name="customer_title_id" type="INTEGER" />
    <column name="company" size="255" type="VARCHAR" />
    <column name="firstname" required="true" size="255" type="VARCHAR" />
    <column name="lastname" required="true" size="255" type="VARCHAR" />
    <column name="address1" required="true" size="255" type="VARCHAR" />
    <column description="				" name="address2" size="255" type="VARCHAR" />
    <column name="address3" size="255" type="VARCHAR" />
    <column name="zipcode" size="10" type="VARCHAR" />
    <column name="city" required="true" size="255" type="VARCHAR" />
    <column name="country_id" required="true" type="INTEGER" />
    <column name="phone" size="20" type="VARCHAR" />
    <column name="cellphone" size="20" type="VARCHAR" />
    <column name="email" size="50" type="VARCHAR" />
    <column name="password" size="255" type="VARCHAR" />
    <column name="algo" size="128" type="VARCHAR" />
    <column name="salt" size="128" type="VARCHAR" />
    <column name="reseller" type="TINYINT" />
    <column name="lang" size="10" type="VARCHAR" />
    <column name="sponsor" size="50" type="VARCHAR" />
    <column name="discount" type="FLOAT" />
    <foreign-key foreignTable="customer_title" name="fk_ customer_customer_title_id" onDelete="SET NULL" onUpdate="RESTRICT">
      <reference foreign="id" local="customer_title_id" />
    </foreign-key>
    <unique name="ref_UNIQUE">
      <unique-column name="ref" />
    </unique>
    <index name="idx_ customer_customer_title_id">
      <index-column name="customer_title_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="address">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="title" size="255" type="VARCHAR" />
    <column name="customer_id" required="true" type="INTEGER" />
    <column name="customer_title_id" type="INTEGER" />
    <column name="company" size="255" type="VARCHAR" />
    <column name="firstname" required="true" size="255" type="VARCHAR" />
    <column name="lastname" required="true" size="255" type="VARCHAR" />
    <column name="address1" required="true" size="255" type="VARCHAR" />
    <column name="address2" required="true" size="255" type="VARCHAR" />
    <column name="address3" required="true" size="255" type="VARCHAR" />
    <column name="zipcode" required="true" size="10" type="VARCHAR" />
    <column name="city" required="true" size="255" type="VARCHAR" />
    <column name="country_id" required="true" type="INTEGER" />
    <column name="phone" size="20" type="VARCHAR" />
    <foreign-key foreignTable="customer" name="fk_address_customer_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="customer_id" />
    </foreign-key>
    <foreign-key foreignTable="customer_title" name="fk_address_customer_title_id" onDelete="RESTRICT" onUpdate="RESTRICT">
      <reference foreign="id" local="customer_title_id" />
    </foreign-key>
    <index name="idx_address_customer_id">
      <index-column name="customer_id" />
    </index>
    <index name="idx_address_customer_title_id">
      <index-column name="customer_title_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="customer_title">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column defaultValue="0" name="by_default" required="true" type="INTEGER" />
    <column name="position" required="true" size="45" type="VARCHAR" />
    <column name="short" size="10" type="VARCHAR" />
    <column name="long" size="45" type="VARCHAR" />
    <behavior name="timestampable" />
    <behavior name="i18n">
      <parameter name="i18n_columns" value="short, long" />
    </behavior>
  </table>
  <table name="lang">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="title" size="100" type="VARCHAR" />
    <column name="code" size="10" type="VARCHAR" />
    <column name="locale" size="45" type="VARCHAR" />
    <column name="url" size="255" type="VARCHAR" />
    <column name="by_default" type="TINYINT" />
    <behavior name="timestampable" />
  </table>
  <table name="folder">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="parent" required="true" type="INTEGER" />
    <column name="link" size="255" type="VARCHAR" />
    <column name="visible" type="TINYINT" />
    <column name="position" type="INTEGER" />
    <column name="title" size="255" type="VARCHAR" />
    <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>
    <behavior name="versionable">
      <parameter name="log_created_at" value="true" />
      <parameter name="log_created_by" value="true" />
    </behavior>
  </table>
  <table name="content">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="visible" type="TINYINT" />
    <column name="position" type="INTEGER" />
    <column name="title" size="255" type="VARCHAR" />
    <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>
    <behavior name="versionable">
      <parameter name="log_created_at" value="true" />
      <parameter name="log_created_by" value="true" />
    </behavior>
  </table>
  <table name="content_assoc">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="category_id" type="INTEGER" />
    <column name="product_id" type="INTEGER" />
    <column name="content_id" type="INTEGER" />
    <column name="position" type="INTEGER" />
    <foreign-key foreignTable="category" name="fk_content_assoc_category_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="category_id" />
    </foreign-key>
    <foreign-key foreignTable="product" name="fk_content_assoc_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="product_id" />
    </foreign-key>
    <foreign-key foreignTable="content" name="fk_content_assoc_content_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="content_id" />
    </foreign-key>
    <index name="idx_content_assoc_category_id">
      <index-column name="category_id" />
    </index>
    <index name="idx_content_assoc_product_id">
      <index-column name="product_id" />
    </index>
    <index name="idx_content_assoc_content_id">
      <index-column name="content_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="image">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="product_id" type="INTEGER" />
    <column name="category_id" type="INTEGER" />
    <column name="folder_id" type="INTEGER" />
    <column name="content_id" type="INTEGER" />
    <column name="file" required="true" size="255" type="VARCHAR" />
    <column name="position" type="INTEGER" />
    <column name="title" size="255" type="VARCHAR" />
    <column name="description" type="CLOB" />
    <column name="chapo" type="LONGVARCHAR" />
    <column name="postscriptum" type="LONGVARCHAR" />
    <foreign-key foreignTable="product" name="fk_image_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="product_id" />
    </foreign-key>
    <foreign-key foreignTable="category" name="fk_image_category_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="category_id" />
    </foreign-key>
    <foreign-key foreignTable="content" name="fk_image_content_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="content_id" />
    </foreign-key>
    <foreign-key foreignTable="folder" name="fk_image_folder_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="folder_id" />
    </foreign-key>
    <index name="idx_image_product_id">
      <index-column name="product_id" />
    </index>
    <index name="idx_image_category_id">
      <index-column name="category_id" />
    </index>
    <index name="idx_image_content_id">
      <index-column name="content_id" />
    </index>
    <index name="idx_image_folder_id">
      <index-column name="folder_id" />
    </index>
    <behavior name="timestampable" />
    <behavior name="i18n">
      <parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
    </behavior>
  </table>
  <table name="document">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="product_id" type="INTEGER" />
    <column name="category_id" type="INTEGER" />
    <column name="folder_id" type="INTEGER" />
    <column name="content_id" type="INTEGER" />
    <column name="file" required="true" size="255" type="VARCHAR" />
    <column name="position" type="INTEGER" />
    <column name="title" size="255" type="VARCHAR" />
    <column name="description" type="CLOB" />
    <column name="chapo" type="LONGVARCHAR" />
    <column name="postscriptum" type="LONGVARCHAR" />
    <foreign-key foreignTable="product" name="fk_document_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="product_id" />
    </foreign-key>
    <foreign-key foreignTable="category" name="fk_document_category_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="category_id" />
    </foreign-key>
    <foreign-key foreignTable="content" name="fk_document_content_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="content_id" />
    </foreign-key>
    <foreign-key foreignTable="folder" name="fk_document_folder_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="folder_id" />
    </foreign-key>
    <index name="idx_document_product_id">
      <index-column name="product_id" />
    </index>
    <index name="idx_document_category_id">
      <index-column name="category_id" />
    </index>
    <index name="idx_document_content_id">
      <index-column name="content_id" />
    </index>
    <index name="idx_document_folder_id">
      <index-column name="folder_id" />
    </index>
    <behavior name="timestampable" />
    <behavior name="i18n">
      <parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
    </behavior>
  </table>
  <table name="order">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="ref" size="45" type="VARCHAR" />
    <column name="customer_id" required="true" type="INTEGER" />
    <column name="address_invoice" type="INTEGER" />
    <column name="address_delivery" type="INTEGER" />
    <column name="invoice_date" type="DATE" />
    <column name="currency_id" type="INTEGER" />
    <column name="currency_rate" required="true" type="FLOAT" />
    <column name="transaction" size="100" type="VARCHAR" />
    <column name="delivery_num" size="100" type="VARCHAR" />
    <column name="invoice" size="100" type="VARCHAR" />
    <column name="postage" type="FLOAT" />
    <column name="payment" required="true" size="45" type="VARCHAR" />
    <column name="carrier" required="true" size="45" type="VARCHAR" />
    <column name="status_id" type="INTEGER" />
    <column name="lang" required="true" size="10" type="VARCHAR" />
    <foreign-key foreignTable="currency" name="fk_order_currency_id" onDelete="SET NULL" onUpdate="RESTRICT">
      <reference foreign="id" local="currency_id" />
    </foreign-key>
    <foreign-key foreignTable="customer" name="fk_order_customer_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="customer_id" />
    </foreign-key>
    <foreign-key foreignTable="order_address" name="fk_order_address_invoice" onDelete="SET NULL" onUpdate="RESTRICT">
      <reference foreign="id" local="address_invoice" />
    </foreign-key>
    <foreign-key foreignTable="order_address" name="fk_order_address_delivery" onDelete="SET NULL" onUpdate="RESTRICT">
      <reference foreign="id" local="address_delivery" />
    </foreign-key>
    <foreign-key foreignTable="order_status" name="fk_order_status_id" onDelete="SET NULL" onUpdate="RESTRICT">
      <reference foreign="id" local="status_id" />
    </foreign-key>
    <index name="idx_order_currency_id">
      <index-column name="currency_id" />
    </index>
    <index name="idx_order_customer_id">
      <index-column name="customer_id" />
    </index>
    <index name="idx_order_address_invoice">
      <index-column name="address_invoice" />
    </index>
    <index name="idx_order_address_delivery">
      <index-column name="address_delivery" />
    </index>
    <index name="idx_order_status_id">
      <index-column name="status_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="currency">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="name" size="45" type="VARCHAR" />
    <column name="code" size="45" type="VARCHAR" />
    <column name="symbol" size="45" type="VARCHAR" />
    <column name="rate" type="FLOAT" />
    <column name="by_default" type="TINYINT" />
    <behavior name="timestampable" />
  </table>
  <table name="order_address">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="customer_title_id" type="INTEGER" />
    <column name="company" size="255" type="VARCHAR" />
    <column name="firstname" required="true" size="255" type="VARCHAR" />
    <column name="lastname" required="true" size="255" type="VARCHAR" />
    <column name="address1" required="true" size="255" type="VARCHAR" />
    <column name="address2" size="255" type="VARCHAR" />
    <column name="address3" size="255" type="VARCHAR" />
    <column name="zipcode" required="true" size="10" type="VARCHAR" />
    <column name="city" required="true" size="255" type="VARCHAR" />
    <column name="phone" size="20" type="VARCHAR" />
    <column name="country_id" required="true" type="INTEGER" />
    <behavior name="timestampable" />
  </table>
  <table name="order_product">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="order_id" required="true" type="INTEGER" />
    <column name="product_ref" size="255" type="VARCHAR" />
    <column name="title" size="255" type="VARCHAR" />
    <column name="description" type="LONGVARCHAR" />
    <column name="chapo" type="LONGVARCHAR" />
    <column name="quantity" required="true" type="FLOAT" />
    <column name="price" required="true" type="FLOAT" />
    <column name="tax" type="FLOAT" />
    <column name="parent" type="INTEGER" />
    <foreign-key foreignTable="order" name="fk_order_product_order_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="order_id" />
    </foreign-key>
    <index name="idx_order_product_order_id">
      <index-column name="order_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="order_status">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="code" size="45" type="VARCHAR" />
    <column name="title" size="255" type="VARCHAR" />
    <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>
  </table>
  <table name="order_feature">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="order_product_id" required="true" type="INTEGER" />
    <column name="feature_desc" size="255" type="VARCHAR" />
    <column name="feature_av_desc" size="255" type="VARCHAR" />
    <foreign-key foreignTable="order_product" name="fk_order_feature_order_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="order_product_id" />
    </foreign-key>
    <index name="idx_order_feature_order_product_id">
      <index-column name="order_product_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="module">
    <column name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="code" required="true" size="55" type="VARCHAR" />
    <column name=" type" required="true" type="TINYINT" />
    <column name="activate" type="TINYINT" />
    <column name="position" type="INTEGER" />
    <column name="title" size="255" type="VARCHAR" />
    <column name="description" type="CLOB" />
    <column name="chapo" type="LONGVARCHAR" />
    <column name="postscriptum" type="LONGVARCHAR" />
    <unique name="code_UNIQUE">
      <unique-column name="code" />
    </unique>
    <behavior name="timestampable" />
    <behavior name="i18n">
      <parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
    </behavior>
  </table>
  <table name="accessory">
    <column name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="product_id" required="true" type="INTEGER" />
    <column name="accessory" required="true" type="INTEGER" />
    <column name="position" required="true" type="INTEGER" />
    <foreign-key foreignTable="product" name="fk_accessory_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="product_id" />
    </foreign-key>
    <foreign-key foreignTable="product" name="fk_accessory_accessory" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="accessory" />
    </foreign-key>
    <index name="idx_address_product_id">
      <index-column name="product_id" />
    </index>
    <index name="idx_address_accessory">
      <index-column name="accessory" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="area">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="name" required="true" size="100" type="VARCHAR" />
    <column name="unit" type="FLOAT" />
    <behavior name="timestampable" />
  </table>
  <table name="delivzone">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="area_id" type="INTEGER" />
    <column name="delivery" required="true" size="45" type="VARCHAR" />
    <foreign-key foreignTable="area" name="fk_delivzone_area_id" onDelete="SET NULL" onUpdate="RESTRICT">
      <reference foreign="id" local="area_id" />
    </foreign-key>
    <index name="idx_delivzone_area_id">
      <index-column name="area_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="group">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="code" required="true" size="30" type="VARCHAR" />
    <column name="title" size="255" type="VARCHAR" />
    <column name="description" type="CLOB" />
    <column name="chapo" type="LONGVARCHAR" />
    <column name="postscriptum" type="LONGVARCHAR" />
    <unique name="code_UNIQUE">
      <unique-column name="code" />
    </unique>
    <behavior name="timestampable" />
    <behavior name="i18n">
      <parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
    </behavior>
  </table>
  <table name="resource">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="code" required="true" size="30" type="VARCHAR" />
    <column name="title" size="255" type="VARCHAR" />
    <column name="description" type="CLOB" />
    <column name="chapo" type="LONGVARCHAR" />
    <column name="postscriptum" type="LONGVARCHAR" />
    <unique name="code_UNIQUE">
      <unique-column name="code" />
    </unique>
    <behavior name="timestampable" />
    <behavior name="i18n">
      <parameter name="i18n_columns" value="title, description, chapo, postscriptum" />
    </behavior>
  </table>
  <table name="admin">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="firstname" required="true" size="100" type="VARCHAR" />
    <column name="lastname" required="true" size="100" type="VARCHAR" />
    <column name="login" required="true" size="100" type="VARCHAR" />
    <column name="password" required="true" size="128" type="VARCHAR" />
    <column name="algo" size="128" type="VARCHAR" />
    <column name="salt" size="128" type="VARCHAR" />
    <behavior name="timestampable" />
  </table>
  <table name="admin_group">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="group_id" type="INTEGER" />
    <column name="admin_id" type="INTEGER" />
    <foreign-key foreignTable="group" name="fk_admin_group_group_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="group_id" />
    </foreign-key>
    <foreign-key foreignTable="admin" name="fk_admin_group_admin_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="admin_id" />
    </foreign-key>
    <index name="idx_admin_group_group_id">
      <index-column name="group_id" />
    </index>
    <index name="idx_admin_group_admin_id">
      <index-column name="admin_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="group_resource">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="group_id" required="true" type="INTEGER" />
    <column name="resource_id" required="true" type="INTEGER" />
    <column defaultValue="0" name="read" type="TINYINT" />
    <column defaultValue="0" name="write" type="TINYINT" />
    <foreign-key foreignTable="group" name="fk_group_resource_group_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="group_id" />
    </foreign-key>
    <foreign-key foreignTable="resource" name="fk_group_resource_resource_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="resource_id" />
    </foreign-key>
    <index name="id_idx">
      <index-column name="group_id" />
    </index>
    <index name="idx_group_resource_resource_id">
      <index-column name="resource_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="group_module">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="group_id" required="true" type="INTEGER" />
    <column name="module_id" type="INTEGER" />
    <column defaultValue="0" name="access" type="TINYINT" />
    <foreign-key foreignTable="group" name="fk_group_module_group_id" onDelete="CASCADE" onUpdate="CASCADE">
      <reference foreign="id" local="group_id" />
    </foreign-key>
    <foreign-key foreignTable="module" name="fk_group_module_module_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="module_id" />
    </foreign-key>
    <index name="id_idx">
      <index-column name="group_id" />
    </index>
    <index name="id_idx1">
      <index-column name="module_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="message">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="code" required="true" size="45" type="VARCHAR" />
    <column name="secured" type="TINYINT" />
    <column name="ref" size="255" type="VARCHAR" />
    <column name="title" type="LONGVARCHAR" />
    <column name="description" type="CLOB" />
    <column name="description_html" type="CLOB" />
    <behavior name="timestampable" />
    <behavior name="i18n">
      <parameter name="i18n_columns" value="title, description, description_html" />
    </behavior>
    <behavior name="versionable">
      <parameter name="log_created_at" value="true" />
      <parameter name="log_created_by" value="true" />
    </behavior>
  </table>
  <table name="rewriting">
    <column name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="url" required="true" size="255" type="VARCHAR" />
    <column name="product_id" type="INTEGER" />
    <column name="category_id" type="INTEGER" />
    <column name="folder_id" type="INTEGER" />
    <column name="content_id" type="INTEGER" />
    <foreign-key foreignTable="product" name="fk_rewriting_product_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="product_id" />
    </foreign-key>
    <foreign-key foreignTable="category" name="fk_rewriting_category_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="category_id" />
    </foreign-key>
    <foreign-key foreignTable="folder" name="fk_rewriting_folder_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="folder_id" />
    </foreign-key>
    <foreign-key foreignTable="content" name="fk_rewriting_content_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="content_id" />
    </foreign-key>
    <index name="idx_rewriting_product_id">
      <index-column name="product_id" />
    </index>
    <index name="idx_rewriting_category_id">
      <index-column name="category_id" />
    </index>
    <index name="idx_rewriting_folder_id">
      <index-column name="folder_id" />
    </index>
    <index name="idx_rewriting_content_id">
      <index-column name="content_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="coupon">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="code" required="true" size="45" type="VARCHAR" />
    <column name="action" required="true" size="255" type="VARCHAR" />
    <column name="value" required="true" type="FLOAT" />
    <column name="used" type="TINYINT" />
    <column name="available_since" type="TIMESTAMP" />
    <column name="date_limit" type="TIMESTAMP" />
    <column name="activate" type="TINYINT" />
    <unique name="code_UNIQUE">
      <unique-column name="code" />
    </unique>
    <behavior name="timestampable" />
  </table>
  <table name="coupon_rule">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="coupon_id" required="true" type="INTEGER" />
    <column name="controller" size="255" type="VARCHAR" />
    <column name="operation" size="255" type="VARCHAR" />
    <column name="value" type="FLOAT" />
    <foreign-key foreignTable="coupon" name="fk_coupon_rule_coupon_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="coupon_id" />
    </foreign-key>
    <index name="idx_coupon_rule_coupon_id">
      <index-column name="coupon_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="coupon_order">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="order_id" required="true" type="INTEGER" />
    <column name="code" required="true" size="45" type="VARCHAR" />
    <column name="value" required="true" type="FLOAT" />
    <foreign-key foreignTable="order" name="fk_coupon_order_order_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="order_id" />
    </foreign-key>
    <index name="idx_coupon_order_order_id">
      <index-column name="order_id" />
    </index>
    <behavior name="timestampable" />
  </table>
  <table name="admin_log">
    <column autoIncrement="true" name="id" primaryKey="true" required="true" type="INTEGER" />
    <column name="admin_login" size="255" type="VARCHAR" />
    <column name="admin_firstname" size="255" type="VARCHAR" />
    <column name="admin_lastname" size="255" type="VARCHAR" />
    <column name="action" size="255" type="VARCHAR" />
    <column name="request" type="LONGVARCHAR" />
    <behavior name="timestampable" />
  </table>
  <table name="content_folder">
    <column name="content_id" primaryKey="true" required="true" type="INTEGER" />
    <column name="folder_id" primaryKey="true" required="true" type="INTEGER" />
    <foreign-key foreignTable="content" name="fk_content_folder_content_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="content_id" />
    </foreign-key>
    <foreign-key foreignTable="folder" name="fk_content_folder_folder_id" onDelete="CASCADE" onUpdate="RESTRICT">
      <reference foreign="id" local="folder_id" />
    </foreign-key>
    <index name="fk__idx">
      <index-column name="content_id" />
    </index>
    <index name="fk_content_folder_folder_id_idx">
      <index-column name="folder_id" />
    </index>
    <behavior name="timestampable" />
  </table>
</database>
