Skip to content

Instantly share code, notes, and snippets.

@marcpicaud
Created March 27, 2016 23:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcpicaud/6e2c8fa495613a89f2c2 to your computer and use it in GitHub Desktop.
Save marcpicaud/6e2c8fa495613a89f2c2 to your computer and use it in GitHub Desktop.
SET SESSION sql_mode = '';
SET NAMES 'utf8';
CREATE TABLE `accessory` (
`id_product_1` int(10) unsigned NOT NULL,
`id_product_2` int(10) unsigned NOT NULL,
KEY `accessory_product` (`id_product_1`,`id_product_2`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `address` (
`id_address` int(10) unsigned NOT NULL auto_increment,
`id_country` int(10) unsigned NOT NULL,
`id_state` int(10) unsigned DEFAULT NULL,
`id_customer` int(10) unsigned NOT NULL DEFAULT '0',
`id_manufacturer` int(10) unsigned NOT NULL DEFAULT '0',
`id_supplier` int(10) unsigned NOT NULL DEFAULT '0',
`id_warehouse` int(10) unsigned NOT NULL DEFAULT '0',
`alias` varchar(32) NOT NULL,
`company` varchar(64) DEFAULT NULL,
`lastname` varchar(255) NOT NULL,
`firstname` varchar(255) NOT NULL,
`address1` varchar(128) NOT NULL,
`address2` varchar(128) DEFAULT NULL,
`postcode` varchar(12) DEFAULT NULL,
`city` varchar(64) NOT NULL,
`other` text,
`phone` varchar(32) DEFAULT NULL,
`phone_mobile` varchar(32) DEFAULT NULL,
`vat_number` varchar(32) DEFAULT NULL,
`dni` varchar(16) DEFAULT NULL,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
`deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id_address`),
KEY `address_customer` (`id_customer`),
KEY `id_country` (`id_country`),
KEY `id_state` (`id_state`),
KEY `id_manufacturer` (`id_manufacturer`),
KEY `id_supplier` (`id_supplier`),
KEY `id_warehouse` (`id_warehouse`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `attachment` (
`id_attachment` int(10) unsigned NOT NULL auto_increment,
`file` varchar(40) NOT NULL,
`file_name` varchar(128) NOT NULL,
`file_size` bigint(10) unsigned NOT NULL DEFAULT '0',
`mime` varchar(128) NOT NULL,
PRIMARY KEY (`id_attachment`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `attachment_lang` (
`id_attachment` int(10) unsigned NOT NULL auto_increment,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(32) DEFAULT NULL,
`description` TEXT,
PRIMARY KEY (`id_attachment`, `id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `product_attachment` (
`id_product` int(10) unsigned NOT NULL,
`id_attachment` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_product`,`id_attachment`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `attribute` (
`id_attribute` int(10) unsigned NOT NULL auto_increment,
`id_attribute_group` int(10) unsigned NOT NULL,
`color` varchar(32) DEFAULT NULL,
`position` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id_attribute`),
KEY `attribute_group` (`id_attribute_group`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `attribute_group` (
`id_attribute_group` int(10) unsigned NOT NULL auto_increment,
`is_color_group` tinyint(1) NOT NULL DEFAULT '0',
`group_type` ENUM('select', 'radio', 'color') NOT NULL DEFAULT 'select',
`position` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id_attribute_group`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `attribute_group_lang` (
`id_attribute_group` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(128) NOT NULL,
`public_name` varchar(64) NOT NULL,
PRIMARY KEY (`id_attribute_group`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `attribute_impact` (
`id_attribute_impact` int(10) unsigned NOT NULL auto_increment,
`id_product` int(11) unsigned NOT NULL,
`id_attribute` int(11) unsigned NOT NULL,
`weight` DECIMAL(20,6) NOT NULL,
`price` decimal(17,2) NOT NULL,
PRIMARY KEY (`id_attribute_impact`),
UNIQUE KEY `id_product` (`id_product`,`id_attribute`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `attribute_lang` (
`id_attribute` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(128) NOT NULL,
PRIMARY KEY (`id_attribute`,`id_lang`),
KEY `id_lang` (`id_lang`,`name`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `carrier` (
`id_carrier` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_reference` int(10) unsigned NOT NULL,
`id_tax_rules_group` int(10) unsigned DEFAULT '0',
`name` varchar(64) NOT NULL,
`url` varchar(255) DEFAULT NULL,
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
`deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
`shipping_handling` tinyint(1) unsigned NOT NULL DEFAULT '1',
`range_behavior` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_module` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_free` tinyint(1) unsigned NOT NULL DEFAULT '0',
`shipping_external` tinyint(1) unsigned NOT NULL DEFAULT '0',
`need_range` tinyint(1) unsigned NOT NULL DEFAULT '0',
`external_module_name` varchar(64) DEFAULT NULL,
`shipping_method` int(2) NOT NULL DEFAULT '0',
`position` int(10) unsigned NOT NULL DEFAULT '0',
`max_width` int(10) DEFAULT '0',
`max_height` int(10) DEFAULT '0',
`max_depth` int(10) DEFAULT '0',
`max_weight` DECIMAL(20,6) DEFAULT '0',
`grade` int(10) DEFAULT '0',
PRIMARY KEY (`id_carrier`),
KEY `deleted` (`deleted`,`active`),
KEY `id_tax_rules_group` (`id_tax_rules_group`),
KEY `reference` (`id_reference`, `deleted`, `active`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `carrier_lang` (
`id_carrier` int(10) unsigned NOT NULL,
`id_shop` int(11) unsigned NOT NULL DEFAULT '1',
`id_lang` int(10) unsigned NOT NULL,
`delay` varchar(128) DEFAULT NULL,
PRIMARY KEY (`id_lang`,`id_shop`, `id_carrier`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `carrier_zone` (
`id_carrier` int(10) unsigned NOT NULL,
`id_zone` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_carrier`,`id_zone`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `cart` (
`id_cart` int(10) unsigned NOT NULL auto_increment,
`id_shop_group` INT(11) UNSIGNED NOT NULL DEFAULT '1',
`id_shop` INT(11) UNSIGNED NOT NULL DEFAULT '1',
`id_carrier` int(10) unsigned NOT NULL,
`delivery_option` TEXT NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`id_address_delivery` int(10) unsigned NOT NULL,
`id_address_invoice` int(10) unsigned NOT NULL,
`id_currency` int(10) unsigned NOT NULL,
`id_customer` int(10) unsigned NOT NULL,
`secure_key` varchar(32) NOT NULL DEFAULT '-1',
`recyclable` tinyint(1) unsigned NOT NULL DEFAULT '1',
`gift` tinyint(1) unsigned NOT NULL DEFAULT '0',
`gift_message` text,
`mobile_theme` tinyint(1) NOT NULL DEFAULT '0',
`allow_seperated_package` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
`checkout_session_data` MEDIUMTEXT NULL,
PRIMARY KEY (`id_cart`),
KEY `cart_customer` (`id_customer`),
KEY `id_address_delivery` (`id_address_delivery`),
KEY `id_address_invoice` (`id_address_invoice`),
KEY `id_carrier` (`id_carrier`),
KEY `id_lang` (`id_lang`),
KEY `id_currency` (`id_currency`),
KEY `id_shop_group` (`id_shop_group`),
KEY `id_shop_2` (`id_shop`,`date_upd`),
KEY `id_shop` (`id_shop`,`date_add`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `cart_rule` (
`id_cart_rule` int(10) unsigned NOT NULL auto_increment,
`id_customer` int unsigned NOT NULL DEFAULT '0',
`date_from` datetime NOT NULL,
`date_to` datetime NOT NULL,
`description` text,
`quantity` int(10) unsigned NOT NULL DEFAULT '0',
`quantity_per_user` int(10) unsigned NOT NULL DEFAULT '0',
`priority` int(10) unsigned NOT NULL DEFAULT 1,
`partial_use` tinyint(1) unsigned NOT NULL DEFAULT '0',
`code` varchar(254) NOT NULL,
`minimum_amount` decimal(17,2) NOT NULL DEFAULT '0',
`minimum_amount_tax` tinyint(1) NOT NULL DEFAULT '0',
`minimum_amount_currency` int unsigned NOT NULL DEFAULT '0',
`minimum_amount_shipping` tinyint(1) NOT NULL DEFAULT '0',
`country_restriction` tinyint(1) unsigned NOT NULL DEFAULT '0',
`carrier_restriction` tinyint(1) unsigned NOT NULL DEFAULT '0',
`group_restriction` tinyint(1) unsigned NOT NULL DEFAULT '0',
`cart_rule_restriction` tinyint(1) unsigned NOT NULL DEFAULT '0',
`product_restriction` tinyint(1) unsigned NOT NULL DEFAULT '0',
`shop_restriction` tinyint(1) unsigned NOT NULL DEFAULT '0',
`free_shipping` tinyint(1) NOT NULL DEFAULT '0',
`reduction_percent` decimal(5,2) NOT NULL DEFAULT '0',
`reduction_amount` decimal(17,2) NOT NULL DEFAULT '0',
`reduction_tax` tinyint(1) unsigned NOT NULL DEFAULT '0',
`reduction_currency` int(10) unsigned NOT NULL DEFAULT '0',
`reduction_product` int(10) NOT NULL DEFAULT '0',
`gift_product` int(10) unsigned NOT NULL DEFAULT '0',
`gift_product_attribute` int(10) unsigned NOT NULL DEFAULT '0',
`highlight` tinyint(1) unsigned NOT NULL DEFAULT '0',
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_cart_rule`),
KEY `id_customer` (`id_customer`, `active`, `date_to`),
KEY `group_restriction` (`group_restriction`, `active`, `date_to`),
KEY `id_customer_2` (`id_customer`,`active`,`highlight`,`date_to`),
KEY `group_restriction_2` (`group_restriction`,`active`,`highlight`,`date_to`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `cart_rule_lang` (
`id_cart_rule` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(254) NOT NULL,
PRIMARY KEY (`id_cart_rule`, `id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `cart_rule_country` (
`id_cart_rule` int(10) unsigned NOT NULL,
`id_country` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_cart_rule`, `id_country`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `cart_rule_group` (
`id_cart_rule` int(10) unsigned NOT NULL,
`id_group` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_cart_rule`, `id_group`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `cart_rule_carrier` (
`id_cart_rule` int(10) unsigned NOT NULL,
`id_carrier` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_cart_rule`, `id_carrier`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `cart_rule_combination` (
`id_cart_rule_1` int(10) unsigned NOT NULL,
`id_cart_rule_2` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_cart_rule_1`, `id_cart_rule_2`),
KEY `id_cart_rule_1` (`id_cart_rule_1`),
KEY `id_cart_rule_2` (`id_cart_rule_2`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `cart_rule_product_rule_group` (
`id_product_rule_group` int(10) unsigned NOT NULL auto_increment,
`id_cart_rule` int(10) unsigned NOT NULL,
`quantity` int(10) unsigned NOT NULL DEFAULT 1,
PRIMARY KEY (`id_product_rule_group`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `cart_rule_product_rule` (
`id_product_rule` int(10) unsigned NOT NULL auto_increment,
`id_product_rule_group` int(10) unsigned NOT NULL,
`type` ENUM('products', 'categories', 'attributes', 'manufacturers', 'suppliers') NOT NULL,
PRIMARY KEY (`id_product_rule`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `cart_rule_product_rule_value` (
`id_product_rule` int(10) unsigned NOT NULL,
`id_item` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_product_rule`, `id_item`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `cart_cart_rule` (
`id_cart` int(10) unsigned NOT NULL,
`id_cart_rule` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_cart`,`id_cart_rule`),
KEY (`id_cart_rule`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `cart_product` (
`id_cart` int(10) unsigned NOT NULL,
`id_product` int(10) unsigned NOT NULL,
`id_address_delivery` int(10) unsigned NOT NULL DEFAULT '0',
`id_shop` int(10) unsigned NOT NULL DEFAULT '1',
`id_product_attribute` int(10) unsigned NOT NULL DEFAULT '0',
`quantity` int(10) unsigned NOT NULL DEFAULT '0',
`date_add` datetime NOT NULL,
PRIMARY KEY (`id_cart`,`id_product`,`id_product_attribute`,`id_address_delivery`),
KEY `id_product_attribute` (`id_product_attribute`),
KEY `id_cart_order` (`id_cart`, `date_add`, `id_product`, `id_product_attribute`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `category` (
`id_category` int(10) unsigned NOT NULL auto_increment,
`id_parent` int(10) unsigned NOT NULL,
`id_shop_default` int(10) unsigned NOT NULL DEFAULT 1,
`level_depth` tinyint(3) unsigned NOT NULL DEFAULT '0',
`nleft` int(10) unsigned NOT NULL DEFAULT '0',
`nright` int(10) unsigned NOT NULL DEFAULT '0',
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
`position` int(10) unsigned NOT NULL DEFAULT '0',
`is_root_category` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_category`),
KEY `category_parent` (`id_parent`),
KEY `nleftrightactive` (`nleft`, `nright`, `active`),
KEY `level_depth` (`level_depth`),
KEY `nright` (`nright`),
KEY `activenleft` (`active`,`nleft`),
KEY `activenright` (`active`,`nright`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `category_group` (
`id_category` int(10) unsigned NOT NULL,
`id_group` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_category`,`id_group`),
KEY `id_category` (`id_category`),
KEY `id_group` (`id_group`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `category_lang` (
`id_category` int(10) unsigned NOT NULL,
`id_shop` INT( 11 ) UNSIGNED NOT NULL DEFAULT '1',
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(128) NOT NULL,
`description` text,
`link_rewrite` varchar(128) NOT NULL,
`meta_title` varchar(128) DEFAULT NULL,
`meta_keywords` varchar(255) DEFAULT NULL,
`meta_description` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id_category`,`id_shop`, `id_lang`),
KEY `category_name` (`name`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `category_product` (
`id_category` int(10) unsigned NOT NULL,
`id_product` int(10) unsigned NOT NULL,
`position` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id_category`,`id_product`),
INDEX (`id_product`),
INDEX (`id_category`, `position`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `contact` (
`id_contact` int(10) unsigned NOT NULL auto_increment,
`email` varchar(128) NOT NULL,
`customer_service` tinyint(1) NOT NULL DEFAULT '0',
`position` tinyint(2) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id_contact`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `contact_lang` (
`id_contact` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(32) NOT NULL,
`description` text,
PRIMARY KEY (`id_contact`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `country` (
`id_country` int(10) unsigned NOT NULL auto_increment,
`id_zone` int(10) unsigned NOT NULL,
`id_currency` int(10) unsigned NOT NULL DEFAULT '0',
`iso_code` varchar(3) NOT NULL,
`call_prefix` int(10) NOT NULL DEFAULT '0',
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
`contains_states` tinyint(1) NOT NULL DEFAULT '0',
`need_identification_number` tinyint(1) NOT NULL DEFAULT '0',
`need_zip_code` tinyint(1) NOT NULL DEFAULT '1',
`zip_code_format` varchar(12) NOT NULL DEFAULT '',
`display_tax_label` BOOLEAN NOT NULL,
PRIMARY KEY (`id_country`),
KEY `country_iso_code` (`iso_code`),
KEY `country_` (`id_zone`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `country_lang` (
`id_country` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(64) NOT NULL,
PRIMARY KEY (`id_country`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `currency` (
`id_currency` int(10) unsigned NOT NULL auto_increment,
`name` varchar(32) NOT NULL,
`iso_code` varchar(3) NOT NULL DEFAULT '0',
`conversion_rate` decimal(13,6) NOT NULL,
`deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`id_currency`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `customer` (
`id_customer` int(10) unsigned NOT NULL auto_increment,
`id_shop_group` INT(11) UNSIGNED NOT NULL DEFAULT '1',
`id_shop` INT(11) UNSIGNED NOT NULL DEFAULT '1',
`id_gender` int(10) unsigned NOT NULL,
`id_default_group` int(10) unsigned NOT NULL DEFAULT '1',
`id_lang` int(10) unsigned NULL,
`id_risk` int(10) unsigned NOT NULL DEFAULT '1',
`company` varchar(64),
`siret` varchar(14),
`ape` varchar(5),
`firstname` varchar(255) NOT NULL,
`lastname` varchar(255) NOT NULL,
`email` varchar(128) NOT NULL,
`passwd` varchar(255) NOT NULL,
`last_passwd_gen` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`birthday` date DEFAULT NULL,
`newsletter` tinyint(1) unsigned NOT NULL DEFAULT '0',
`ip_registration_newsletter` varchar(15) DEFAULT NULL,
`newsletter_date_add` datetime DEFAULT NULL,
`optin` tinyint(1) unsigned NOT NULL DEFAULT '0',
`website` varchar(128),
`outstanding_allow_amount` DECIMAL( 20,6 ) NOT NULL DEFAULT '0.00',
`show_public_prices` tinyint(1) unsigned NOT NULL DEFAULT '0',
`max_payment_days` int(10) unsigned NOT NULL DEFAULT '60',
`secure_key` varchar(32) NOT NULL DEFAULT '-1',
`note` text,
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_guest` tinyint(1) NOT NULL DEFAULT '0',
`deleted` tinyint(1) NOT NULL DEFAULT '0',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
`reset_password_token` varchar(40) DEFAULT NULL,
`reset_password_validity` datetime DEFAULT NULL,
PRIMARY KEY (`id_customer`),
KEY `customer_email` (`email`),
KEY `customer_login` (`email`,`passwd`),
KEY `id_customer_passwd` (`id_customer`,`passwd`),
KEY `id_gender` (`id_gender`),
KEY `id_shop_group` (`id_shop_group`),
KEY `id_shop` (`id_shop`, `date_add`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `customer_group` (
`id_customer` int(10) unsigned NOT NULL,
`id_group` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_customer`,`id_group`),
INDEX customer_login(id_group),
KEY `id_customer` (`id_customer`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `customer_message` (
`id_customer_message` int(10) unsigned NOT NULL auto_increment,
`id_customer_thread` int(11) DEFAULT NULL,
`id_employee` int(10) unsigned DEFAULT NULL,
`message` MEDIUMTEXT NOT NULL,
`file_name` varchar(18) DEFAULT NULL,
`ip_address` varchar(16) DEFAULT NULL,
`user_agent` varchar(128) DEFAULT NULL,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
`private` TINYINT NOT NULL DEFAULT '0',
`read` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_customer_message`),
KEY `id_customer_thread` (`id_customer_thread`),
KEY `id_employee` (`id_employee`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `customer_message_sync_imap` (
`md5_header` varbinary(32) NOT NULL,
KEY `md5_header_index` (`md5_header`(4))
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `customer_thread` (
`id_customer_thread` int(11) unsigned NOT NULL auto_increment,
`id_shop` INT(11) UNSIGNED NOT NULL DEFAULT '1',
`id_lang` int(10) unsigned NOT NULL,
`id_contact` int(10) unsigned NOT NULL,
`id_customer` int(10) unsigned DEFAULT NULL,
`id_order` int(10) unsigned DEFAULT NULL,
`id_product` int(10) unsigned DEFAULT NULL,
`status` enum('open','closed','pending1','pending2') NOT NULL DEFAULT 'open',
`email` varchar(128) NOT NULL,
`token` varchar(12) DEFAULT NULL,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_customer_thread`),
KEY `id_shop` (`id_shop`),
KEY `id_lang` (`id_lang`),
KEY `id_contact` (`id_contact`),
KEY `id_customer` (`id_customer`),
KEY `id_order` (`id_order`),
KEY `id_product` (`id_product`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `customization` (
`id_customization` int(10) unsigned NOT NULL auto_increment,
`id_product_attribute` int(10) unsigned NOT NULL DEFAULT '0',
`id_address_delivery` int(10) UNSIGNED NOT NULL DEFAULT '0',
`id_cart` int(10) unsigned NOT NULL,
`id_product` int(10) NOT NULL,
`quantity` int(10) NOT NULL,
`quantity_refunded` INT NOT NULL DEFAULT '0',
`quantity_returned` INT NOT NULL DEFAULT '0',
`in_cart` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`id_customization`,`id_cart`,`id_product`, `id_address_delivery`),
KEY `id_product_attribute` (`id_product_attribute`),
KEY `id_cart_product` (`id_cart`, `id_product`, `id_product_attribute`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `customization_field` (
`id_customization_field` int(10) unsigned NOT NULL auto_increment,
`id_product` int(10) unsigned NOT NULL,
`type` tinyint(1) NOT NULL,
`required` tinyint(1) NOT NULL,
PRIMARY KEY (`id_customization_field`),
KEY `id_product` (`id_product`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `customization_field_lang` (
`id_customization_field` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`id_shop` int(10) UNSIGNED NOT NULL DEFAULT '1',
`name` varchar(255) NOT NULL,
PRIMARY KEY (`id_customization_field`,`id_lang`, `id_shop`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `customized_data` (
`id_customization` int(10) unsigned NOT NULL,
`type` tinyint(1) NOT NULL,
`index` int(3) NOT NULL,
`value` varchar(255) NOT NULL,
PRIMARY KEY (`id_customization`,`type`,`index`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `date_range` (
`id_date_range` int(10) unsigned NOT NULL auto_increment,
`time_start` datetime NOT NULL,
`time_end` datetime NOT NULL,
PRIMARY KEY (`id_date_range`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `delivery` (
`id_delivery` int(10) unsigned NOT NULL auto_increment,
`id_shop` INT UNSIGNED NULL DEFAULT NULL,
`id_shop_group` INT UNSIGNED NULL DEFAULT NULL,
`id_carrier` int(10) unsigned NOT NULL,
`id_range_price` int(10) unsigned DEFAULT NULL,
`id_range_weight` int(10) unsigned DEFAULT NULL,
`id_zone` int(10) unsigned NOT NULL,
`price` decimal(20,6) NOT NULL,
PRIMARY KEY (`id_delivery`),
KEY `id_zone` (`id_zone`),
KEY `id_carrier` (`id_carrier`,`id_zone`),
KEY `id_range_price` (`id_range_price`),
KEY `id_range_weight` (`id_range_weight`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `feature` (
`id_feature` int(10) unsigned NOT NULL auto_increment,
`position` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id_feature`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `feature_lang` (
`id_feature` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(128) DEFAULT NULL,
PRIMARY KEY (`id_feature`,`id_lang`),
KEY (`id_lang`,`name`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `feature_product` (
`id_feature` int(10) unsigned NOT NULL,
`id_product` int(10) unsigned NOT NULL,
`id_feature_value` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_feature`,`id_product`),
KEY `id_feature_value` (`id_feature_value`),
KEY `id_product` (`id_product`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `feature_value` (
`id_feature_value` int(10) unsigned NOT NULL auto_increment,
`id_feature` int(10) unsigned NOT NULL,
`custom` tinyint(3) unsigned DEFAULT NULL,
PRIMARY KEY (`id_feature_value`),
KEY `feature` (`id_feature`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `feature_value_lang` (
`id_feature_value` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`value` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id_feature_value`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE IF NOT EXISTS `gender` (
`id_gender` int(11) NOT NULL AUTO_INCREMENT,
`type` tinyint(1) NOT NULL,
PRIMARY KEY (`id_gender`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE IF NOT EXISTS `gender_lang` (
`id_gender` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(20) NOT NULL,
PRIMARY KEY (`id_gender`,`id_lang`),
KEY `id_gender` (`id_gender`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `group` (
`id_group` int(10) unsigned NOT NULL auto_increment,
`reduction` decimal(17,2) NOT NULL DEFAULT '0.00',
`price_display_method` TINYINT NOT NULL DEFAULT '0',
`show_prices` tinyint(1) unsigned NOT NULL DEFAULT '1',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_group`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `group_lang` (
`id_group` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(32) NOT NULL,
PRIMARY KEY (`id_group`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `group_reduction` (
`id_group_reduction` MEDIUMINT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_group` INT(10) UNSIGNED NOT NULL,
`id_category` INT(10) UNSIGNED NOT NULL,
`reduction` DECIMAL(4, 3) NOT NULL,
PRIMARY KEY (`id_group_reduction`),
UNIQUE KEY(`id_group`, `id_category`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `product_group_reduction_cache` (
`id_product` INT UNSIGNED NOT NULL,
`id_group` INT UNSIGNED NOT NULL,
`reduction` DECIMAL(4, 3) NOT NULL,
PRIMARY KEY (`id_product`, `id_group`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `product_carrier` (
`id_product` int(10) unsigned NOT NULL,
`id_carrier_reference` int(10) unsigned NOT NULL,
`id_shop` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_product`, `id_carrier_reference`, `id_shop`)
) ENGINE = ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `image` (
`id_image` int(10) unsigned NOT NULL auto_increment,
`id_product` int(10) unsigned NOT NULL,
`position` smallint(2) unsigned NOT NULL DEFAULT '0',
`cover` tinyint(1) unsigned NULL DEFAULT NULL,
PRIMARY KEY (`id_image`),
KEY `image_product` (`id_product`),
UNIQUE KEY `id_product_cover` (`id_product`,`cover`),
UNIQUE KEY `idx_product_image` (`id_image`, `id_product`, `cover`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `image_lang` (
`id_image` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`legend` varchar(128) DEFAULT NULL,
PRIMARY KEY (`id_image`,`id_lang`),
KEY `id_image` (`id_image`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `image_type` (
`id_image_type` int(10) unsigned NOT NULL auto_increment,
`name` varchar(64) NOT NULL,
`width` int(10) unsigned NOT NULL,
`height` int(10) unsigned NOT NULL,
`products` tinyint(1) NOT NULL DEFAULT '1',
`categories` tinyint(1) NOT NULL DEFAULT '1',
`manufacturers` tinyint(1) NOT NULL DEFAULT '1',
`suppliers` tinyint(1) NOT NULL DEFAULT '1',
`stores` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`id_image_type`),
KEY `image_type_name` (`name`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `lang` (
`id_lang` int(10) unsigned NOT NULL auto_increment,
`name` varchar(32) NOT NULL,
`active` tinyint(3) unsigned NOT NULL DEFAULT '0',
`iso_code` char(2) NOT NULL,
`language_code` char(5) NOT NULL,
`date_format_lite` char(32) NOT NULL DEFAULT 'Y-m-d',
`date_format_full` char(32) NOT NULL DEFAULT 'Y-m-d H:i:s',
`is_rtl` TINYINT(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_lang`),
KEY `lang_iso_code` (`iso_code`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `manufacturer` (
`id_manufacturer` int(10) unsigned NOT NULL auto_increment,
`name` varchar(64) NOT NULL,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_manufacturer`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `manufacturer_lang` (
`id_manufacturer` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`description` text,
`short_description` text,
`meta_title` varchar(128) DEFAULT NULL,
`meta_keywords` varchar(255) DEFAULT NULL,
`meta_description` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id_manufacturer`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `orders` (
`id_order` int(10) unsigned NOT NULL auto_increment,
`reference` VARCHAR(9),
`id_shop_group` INT(11) UNSIGNED NOT NULL DEFAULT '1',
`id_shop` INT(11) UNSIGNED NOT NULL DEFAULT '1',
`id_carrier` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`id_customer` int(10) unsigned NOT NULL,
`id_cart` int(10) unsigned NOT NULL,
`id_currency` int(10) unsigned NOT NULL,
`id_address_delivery` int(10) unsigned NOT NULL,
`id_address_invoice` int(10) unsigned NOT NULL,
`current_state` int(10) unsigned NOT NULL,
`secure_key` varchar(32) NOT NULL DEFAULT '-1',
`payment` varchar(255) NOT NULL,
`conversion_rate` decimal(13,6) NOT NULL DEFAULT 1,
`module` varchar(255) DEFAULT NULL,
`recyclable` tinyint(1) unsigned NOT NULL DEFAULT '0',
`gift` tinyint(1) unsigned NOT NULL DEFAULT '0',
`gift_message` text,
`mobile_theme` tinyint(1) NOT NULL DEFAULT '0',
`shipping_number` varchar(64) DEFAULT NULL,
`total_discounts` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_discounts_tax_incl` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_discounts_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_paid` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_paid_tax_incl` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_paid_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_paid_real` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_products` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_products_wt` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_shipping` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_shipping_tax_incl` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_shipping_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.00',
`carrier_tax_rate` DECIMAL(10, 3) NOT NULL DEFAULT '0.00',
`total_wrapping` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_wrapping_tax_incl` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_wrapping_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.00',
`round_mode` tinyint(1) NOT NULL DEFAULT '2',
`round_type` tinyint(1) NOT NULL DEFAULT '1',
`invoice_number` int(10) unsigned NOT NULL DEFAULT '0',
`delivery_number` int(10) unsigned NOT NULL DEFAULT '0',
`invoice_date` datetime NOT NULL,
`delivery_date` datetime NOT NULL,
`valid` int(1) unsigned NOT NULL DEFAULT '0',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_order`),
KEY `reference` (`reference`),
KEY `id_customer` (`id_customer`),
KEY `id_cart` (`id_cart`),
KEY `invoice_number` (`invoice_number`),
KEY `id_carrier` (`id_carrier`),
KEY `id_lang` (`id_lang`),
KEY `id_currency` (`id_currency`),
KEY `id_address_delivery` (`id_address_delivery`),
KEY `id_address_invoice` (`id_address_invoice`),
KEY `id_shop_group` (`id_shop_group`),
KEY (`current_state`),
KEY `id_shop` (`id_shop`),
INDEX `date_add`(`date_add`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_detail_tax` (
`id_order_detail` int(11) NOT NULL,
`id_tax` int(11) NOT NULL,
`unit_amount` DECIMAL(16, 6) NOT NULL DEFAULT '0.00',
`total_amount` DECIMAL(16, 6) NOT NULL DEFAULT '0.00',
KEY (`id_order_detail`),
KEY `id_tax` (`id_tax`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_invoice` (
`id_order_invoice` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_order` int(11) NOT NULL,
`number` int(11) NOT NULL,
`delivery_number` int(11) NOT NULL,
`delivery_date` datetime,
`total_discount_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_discount_tax_incl` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_paid_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.00',
`total_paid_tax_incl` decimal(20, 6) NOT NULL DEFAULT '0.00',
`total_products` decimal(20, 6) NOT NULL DEFAULT '0.00',
`total_products_wt` decimal(20, 6) NOT NULL DEFAULT '0.00',
`total_shipping_tax_excl` decimal(20, 6) NOT NULL DEFAULT '0.00',
`total_shipping_tax_incl` decimal(20, 6) NOT NULL DEFAULT '0.00',
`shipping_tax_computation_method` int(10) unsigned NOT NULL,
`total_wrapping_tax_excl` decimal(20, 6) NOT NULL DEFAULT '0.00',
`total_wrapping_tax_incl` decimal(20, 6) NOT NULL DEFAULT '0.00',
`shop_address` text DEFAULT NULL,
`invoice_address` text DEFAULT NULL,
`delivery_address` text DEFAULT NULL,
`note` text,
`date_add` datetime NOT NULL,
PRIMARY KEY (`id_order_invoice`),
KEY `id_order` (`id_order`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE IF NOT EXISTS `order_invoice_tax` (
`id_order_invoice` int(11) NOT NULL,
`type` varchar(15) NOT NULL,
`id_tax` int(11) NOT NULL,
`amount` decimal(10,6) NOT NULL DEFAULT '0.000000',
KEY `id_tax` (`id_tax`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_detail` (
`id_order_detail` int(10) unsigned NOT NULL auto_increment,
`id_order` int(10) unsigned NOT NULL,
`id_order_invoice` int(11) DEFAULT NULL,
`id_warehouse` int(10) unsigned DEFAULT '0',
`id_shop` int(11) unsigned NOT NULL,
`product_id` int(10) unsigned NOT NULL,
`product_attribute_id` int(10) unsigned DEFAULT NULL,
`product_name` varchar(255) NOT NULL,
`product_quantity` int(10) unsigned NOT NULL DEFAULT '0',
`product_quantity_in_stock` int(10) NOT NULL DEFAULT '0',
`product_quantity_refunded` int(10) unsigned NOT NULL DEFAULT '0',
`product_quantity_return` int(10) unsigned NOT NULL DEFAULT '0',
`product_quantity_reinjected` int(10) unsigned NOT NULL DEFAULT '0',
`product_price` decimal(20,6) NOT NULL DEFAULT '0.000000',
`reduction_percent` DECIMAL(10, 2) NOT NULL DEFAULT '0.00',
`reduction_amount` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000',
`reduction_amount_tax_incl` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000',
`reduction_amount_tax_excl` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000',
`group_reduction` DECIMAL(10, 2) NOT NULL DEFAULT '0.000000',
`product_quantity_discount` decimal(20,6) NOT NULL DEFAULT '0.000000',
`product_ean13` varchar(13) DEFAULT NULL,
`product_isbn` varchar(13) DEFAULT NULL,
`product_upc` varchar(12) DEFAULT NULL,
`product_reference` varchar(32) DEFAULT NULL,
`product_supplier_reference` varchar(32) DEFAULT NULL,
`product_weight` DECIMAL(20,6) NOT NULL,
`id_tax_rules_group` INT(11) UNSIGNED DEFAULT '0',
`tax_computation_method` tinyint(1) unsigned NOT NULL DEFAULT '0',
`tax_name` varchar(16) NOT NULL,
`tax_rate` DECIMAL(10,3) NOT NULL DEFAULT '0.000',
`ecotax` decimal(21,6) NOT NULL DEFAULT '0.00',
`ecotax_tax_rate` DECIMAL(5,3) NOT NULL DEFAULT '0.000',
`discount_quantity_applied` TINYINT(1) NOT NULL DEFAULT '0',
`download_hash` varchar(255) DEFAULT NULL,
`download_nb` int(10) unsigned DEFAULT '0',
`download_deadline` datetime DEFAULT NULL,
`total_price_tax_incl` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000',
`total_price_tax_excl` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000',
`unit_price_tax_incl` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000',
`unit_price_tax_excl` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000',
`total_shipping_price_tax_incl` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000',
`total_shipping_price_tax_excl` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000',
`purchase_supplier_price` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000',
`original_product_price` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000',
`original_wholesale_price` DECIMAL(20, 6) NOT NULL DEFAULT '0.000000',
PRIMARY KEY (`id_order_detail`),
KEY `order_detail_order` (`id_order`),
KEY `product_id` (`product_id`),
KEY `product_attribute_id` (`product_attribute_id`),
KEY `id_tax_rules_group` (`id_tax_rules_group`),
KEY `id_order_id_order_detail` (`id_order`, `id_order_detail`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_cart_rule` (
`id_order_cart_rule` int(10) unsigned NOT NULL auto_increment,
`id_order` int(10) unsigned NOT NULL,
`id_cart_rule` int(10) unsigned NOT NULL,
`id_order_invoice` int(10) unsigned DEFAULT '0',
`name` varchar(254) NOT NULL,
`value` decimal(17,2) NOT NULL DEFAULT '0.00',
`value_tax_excl` decimal(17,2) NOT NULL DEFAULT '0.00',
`free_shipping` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_order_cart_rule`),
KEY `id_order` (`id_order`),
KEY `id_cart_rule` (`id_cart_rule`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_history` (
`id_order_history` int(10) unsigned NOT NULL auto_increment,
`id_employee` int(10) unsigned NOT NULL,
`id_order` int(10) unsigned NOT NULL,
`id_order_state` int(10) unsigned NOT NULL,
`date_add` datetime NOT NULL,
PRIMARY KEY (`id_order_history`),
KEY `order_history_order` (`id_order`),
KEY `id_employee` (`id_employee`),
KEY `id_order_state` (`id_order_state`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_message` (
`id_order_message` int(10) unsigned NOT NULL auto_increment,
`date_add` datetime NOT NULL,
PRIMARY KEY (`id_order_message`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_message_lang` (
`id_order_message` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(128) NOT NULL,
`message` text NOT NULL,
PRIMARY KEY (`id_order_message`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_return` (
`id_order_return` int(10) unsigned NOT NULL auto_increment,
`id_customer` int(10) unsigned NOT NULL,
`id_order` int(10) unsigned NOT NULL,
`state` tinyint(1) unsigned NOT NULL DEFAULT '1',
`question` text NOT NULL,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_order_return`),
KEY `order_return_customer` (`id_customer`),
KEY `id_order` (`id_order`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_return_detail` (
`id_order_return` int(10) unsigned NOT NULL,
`id_order_detail` int(10) unsigned NOT NULL,
`id_customization` int(10) unsigned NOT NULL DEFAULT '0',
`product_quantity` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id_order_return`,`id_order_detail`,`id_customization`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_return_state` (
`id_order_return_state` int(10) unsigned NOT NULL auto_increment,
`color` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id_order_return_state`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_return_state_lang` (
`id_order_return_state` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(64) NOT NULL,
PRIMARY KEY (`id_order_return_state`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_slip` (
`id_order_slip` int(10) unsigned NOT NULL auto_increment,
`conversion_rate` decimal(13,6) NOT NULL DEFAULT 1,
`id_customer` int(10) unsigned NOT NULL,
`id_order` int(10) unsigned NOT NULL,
`total_products_tax_excl` DECIMAL(20, 6) NULL,
`total_products_tax_incl` DECIMAL(20, 6) NULL,
`total_shipping_tax_excl` DECIMAL(20, 6) NULL,
`total_shipping_tax_incl` DECIMAL(20, 6) NULL,
`shipping_cost` tinyint(3) unsigned NOT NULL DEFAULT '0',
`amount` DECIMAL(10,2) NOT NULL,
`shipping_cost_amount` DECIMAL(10,2) NOT NULL,
`partial` TINYINT(1) NOT NULL,
`order_slip_type` TINYINT(1) unsigned NOT NULL DEFAULT '0',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_order_slip`),
KEY `order_slip_customer` (`id_customer`),
KEY `id_order` (`id_order`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_slip_detail` (
`id_order_slip` int(10) unsigned NOT NULL,
`id_order_detail` int(10) unsigned NOT NULL,
`product_quantity` int(10) unsigned NOT NULL DEFAULT '0',
`unit_price_tax_excl` DECIMAL(20, 6) NULL,
`unit_price_tax_incl` DECIMAL(20, 6) NULL,
`total_price_tax_excl` DECIMAL(20, 6) NULL,
`total_price_tax_incl` DECIMAL(20, 6),
`amount_tax_excl` DECIMAL(20, 6) DEFAULT NULL,
`amount_tax_incl` DECIMAL(20, 6) DEFAULT NULL,
PRIMARY KEY (`id_order_slip`,`id_order_detail`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_state` (
`id_order_state` int(10) UNSIGNED NOT NULL auto_increment,
`invoice` tinyint(1) UNSIGNED DEFAULT '0',
`send_email` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`module_name` VARCHAR(255) NULL DEFAULT NULL,
`color` varchar(32) DEFAULT NULL,
`unremovable` tinyint(1) UNSIGNED NOT NULL,
`hidden` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`logable` tinyint(1) NOT NULL DEFAULT '0',
`delivery` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`shipped` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`paid` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
`pdf_invoice` tinyint(1) UNSIGNED NOT NULL default '0',
`pdf_delivery` tinyint(1) UNSIGNED NOT NULL default '0',
`deleted` tinyint(1) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`id_order_state`),
KEY `module_name` (`module_name`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_state_lang` (
`id_order_state` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(64) NOT NULL,
`template` varchar(64) NOT NULL,
PRIMARY KEY (`id_order_state`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `pack` (
`id_product_pack` int(10) unsigned NOT NULL,
`id_product_item` int(10) unsigned NOT NULL,
`id_product_attribute_item` int(10) unsigned NOT NULL,
`quantity` int(10) unsigned NOT NULL DEFAULT 1,
PRIMARY KEY (`id_product_pack`, `id_product_item`, `id_product_attribute_item`),
KEY `product_item` (`id_product_item`,`id_product_attribute_item`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_payment` (
`id_order_payment` INT NOT NULL auto_increment,
`order_reference` VARCHAR(9),
`id_currency` INT UNSIGNED NOT NULL,
`amount` DECIMAL(10,2) NOT NULL,
`payment_method` varchar(255) NOT NULL,
`conversion_rate` decimal(13,6) NOT NULL DEFAULT 1,
`transaction_id` VARCHAR(254) NULL,
`card_number` VARCHAR(254) NULL,
`card_brand` VARCHAR(254) NULL,
`card_expiration` CHAR(7) NULL,
`card_holder` VARCHAR(254) NULL,
`date_add` DATETIME NOT NULL,
PRIMARY KEY (`id_order_payment`),
KEY `order_reference`(`order_reference`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `product` (
`id_product` int(10) unsigned NOT NULL auto_increment,
`id_supplier` int(10) unsigned DEFAULT NULL,
`id_manufacturer` int(10) unsigned DEFAULT NULL,
`id_category_default` int(10) unsigned DEFAULT NULL,
`id_shop_default` int(10) unsigned NOT NULL DEFAULT 1,
`id_tax_rules_group` INT(11) UNSIGNED NOT NULL,
`on_sale` tinyint(1) unsigned NOT NULL DEFAULT '0',
`online_only` tinyint(1) unsigned NOT NULL DEFAULT '0',
`ean13` varchar(13) DEFAULT NULL,
`isbn` varchar(13) DEFAULT NULL,
`upc` varchar(12) DEFAULT NULL,
`ecotax` decimal(17,6) NOT NULL DEFAULT '0.00',
`quantity` int(10) NOT NULL DEFAULT '0',
`minimal_quantity` int(10) unsigned NOT NULL DEFAULT '1',
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
`wholesale_price` decimal(20,6) NOT NULL DEFAULT '0.000000',
`unity` varchar(255) DEFAULT NULL,
`unit_price_ratio` decimal(20,6) NOT NULL DEFAULT '0.000000',
`additional_shipping_cost` decimal(20,2) NOT NULL DEFAULT '0.00',
`reference` varchar(32) DEFAULT NULL,
`supplier_reference` varchar(32) DEFAULT NULL,
`location` varchar(64) DEFAULT NULL,
`width` DECIMAL(20, 6) NOT NULL DEFAULT '0',
`height` DECIMAL(20, 6) NOT NULL DEFAULT '0',
`depth` DECIMAL(20, 6) NOT NULL DEFAULT '0',
`weight` DECIMAL(20, 6) NOT NULL DEFAULT '0',
`out_of_stock` int(10) unsigned NOT NULL DEFAULT '2',
`quantity_discount` tinyint(1) DEFAULT '0',
`customizable` tinyint(2) NOT NULL DEFAULT '0',
`uploadable_files` tinyint(4) NOT NULL DEFAULT '0',
`text_fields` tinyint(4) NOT NULL DEFAULT '0',
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
`redirect_type` ENUM('', '404', '301', '302') NOT NULL DEFAULT '',
`id_product_redirected` int(10) unsigned NOT NULL DEFAULT '0',
`available_for_order` tinyint(1) NOT NULL DEFAULT '1',
`available_date` date NOT NULL DEFAULT '0000-00-00',
`show_condition` tinyint(1) NOT NULL DEFAULT '0',
`condition` ENUM('new', 'used', 'refurbished') NOT NULL DEFAULT 'new',
`show_price` tinyint(1) NOT NULL DEFAULT '1',
`indexed` tinyint(1) NOT NULL DEFAULT '0',
`visibility` ENUM('both', 'catalog', 'search', 'none') NOT NULL DEFAULT 'both',
`cache_is_pack` tinyint(1) NOT NULL DEFAULT '0',
`cache_has_attachments` tinyint(1) NOT NULL DEFAULT '0',
`is_virtual` tinyint(1) NOT NULL DEFAULT '0',
`cache_default_attribute` int(10) unsigned DEFAULT NULL,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
`advanced_stock_management` tinyint(1) DEFAULT '0' NOT NULL,
`pack_stock_type` int(11) unsigned DEFAULT '3' NOT NULL,
PRIMARY KEY (`id_product`),
KEY `product_supplier` (`id_supplier`),
KEY `product_manufacturer` (`id_manufacturer`, `id_product`),
KEY `id_category_default` (`id_category_default`),
KEY `indexed` (`indexed`),
KEY `date_add` (`date_add`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `product_attribute` (
`id_product_attribute` int(10) unsigned NOT NULL auto_increment,
`id_product` int(10) unsigned NOT NULL,
`reference` varchar(32) DEFAULT NULL,
`supplier_reference` varchar(32) DEFAULT NULL,
`location` varchar(64) DEFAULT NULL,
`ean13` varchar(13) DEFAULT NULL,
`isbn` varchar(13) DEFAULT NULL,
`upc` varchar(12) DEFAULT NULL,
`wholesale_price` decimal(20,6) NOT NULL DEFAULT '0.000000',
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
`ecotax` decimal(17,6) NOT NULL DEFAULT '0.00',
`quantity` int(10) NOT NULL DEFAULT '0',
`weight` DECIMAL(20,6) NOT NULL DEFAULT '0',
`unit_price_impact` DECIMAL(20,6) NOT NULL DEFAULT '0.00',
`default_on` tinyint(1) unsigned NULL DEFAULT NULL,
`minimal_quantity` int(10) unsigned NOT NULL DEFAULT '1',
`available_date` date NOT NULL DEFAULT '0000-00-00',
PRIMARY KEY (`id_product_attribute`),
KEY `product_attribute_product` (`id_product`),
KEY `reference` (`reference`),
KEY `supplier_reference` (`supplier_reference`),
UNIQUE KEY `product_default` (`id_product`,`default_on`),
KEY `id_product_id_product_attribute` (`id_product_attribute` , `id_product`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `product_attribute_combination` (
`id_attribute` int(10) unsigned NOT NULL,
`id_product_attribute` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_attribute`,`id_product_attribute`),
KEY `id_product_attribute` (`id_product_attribute`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `product_attribute_image` (
`id_product_attribute` int(10) unsigned NOT NULL,
`id_image` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_product_attribute`,`id_image`),
KEY `id_image` (`id_image`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `product_download` (
`id_product_download` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_product` int(10) unsigned NOT NULL,
`display_filename` varchar(255) DEFAULT NULL,
`filename` varchar(255) DEFAULT NULL,
`date_add` datetime NOT NULL,
`date_expiration` datetime DEFAULT NULL,
`nb_days_accessible` int(10) unsigned DEFAULT NULL,
`nb_downloadable` int(10) unsigned DEFAULT '1',
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
`is_shareable` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id_product_download`),
KEY `product_active` (`id_product`,`active`),
UNIQUE KEY `id_product` (`id_product`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `product_lang` (
`id_product` int(10) unsigned NOT NULL,
`id_shop` INT( 11 ) UNSIGNED NOT NULL DEFAULT '1',
`id_lang` int(10) unsigned NOT NULL,
`description` text,
`description_short` text,
`link_rewrite` varchar(128) NOT NULL,
`meta_description` varchar(255) DEFAULT NULL,
`meta_keywords` varchar(255) DEFAULT NULL,
`meta_title` varchar(128) DEFAULT NULL,
`name` varchar(128) NOT NULL,
`available_now` varchar(255) DEFAULT NULL,
`available_later` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id_product`, `id_shop` , `id_lang`),
KEY `id_lang` (`id_lang`),
KEY `name` (`name`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `product_sale` (
`id_product` int(10) unsigned NOT NULL,
`quantity` int(10) unsigned NOT NULL DEFAULT '0',
`sale_nbr` int(10) unsigned NOT NULL DEFAULT '0',
`date_upd` date NOT NULL,
PRIMARY KEY (`id_product`),
KEY `quantity` (`quantity`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `product_tag` (
`id_product` int(10) unsigned NOT NULL,
`id_tag` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_product`,`id_tag`),
KEY `id_tag` (`id_tag`),
KEY `id_lang` (`id_lang`,`id_tag`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `range_price` (
`id_range_price` int(10) unsigned NOT NULL auto_increment,
`id_carrier` int(10) unsigned NOT NULL,
`delimiter1` decimal(20,6) NOT NULL,
`delimiter2` decimal(20,6) NOT NULL,
PRIMARY KEY (`id_range_price`),
UNIQUE KEY `id_carrier` (`id_carrier`,`delimiter1`,`delimiter2`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `range_weight` (
`id_range_weight` int(10) unsigned NOT NULL auto_increment,
`id_carrier` int(10) unsigned NOT NULL,
`delimiter1` decimal(20,6) NOT NULL,
`delimiter2` decimal(20,6) NOT NULL,
PRIMARY KEY (`id_range_weight`),
UNIQUE KEY `id_carrier` (`id_carrier`,`delimiter1`,`delimiter2`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE IF NOT EXISTS `request_sql` (
`id_request_sql` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(200) NOT NULL,
`sql` text NOT NULL,
PRIMARY KEY (`id_request_sql`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `search_engine` (
`id_search_engine` int(10) unsigned NOT NULL auto_increment,
`server` varchar(64) NOT NULL,
`getvar` varchar(16) NOT NULL,
PRIMARY KEY (`id_search_engine`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `search_index` (
`id_product` int(11) unsigned NOT NULL,
`id_word` int(11) unsigned NOT NULL,
`weight` smallint(4) unsigned NOT NULL DEFAULT 1,
PRIMARY KEY (`id_word`, `id_product`),
KEY `id_product` (`id_product`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `search_word` (
`id_word` int(10) unsigned NOT NULL auto_increment,
`id_shop` int(11) unsigned NOT NULL DEFAULT 1,
`id_lang` int(10) unsigned NOT NULL,
`word` varchar(15) NOT NULL,
PRIMARY KEY (`id_word`),
UNIQUE KEY `id_lang` (`id_lang`,`id_shop`, `word`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `specific_price` (
`id_specific_price` INT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_specific_price_rule` INT(11) UNSIGNED NOT NULL,
`id_cart` INT(11) UNSIGNED NOT NULL,
`id_product` INT UNSIGNED NOT NULL,
`id_shop` INT(11) UNSIGNED NOT NULL DEFAULT '1',
`id_shop_group` INT(11) UNSIGNED NOT NULL,
`id_currency` INT UNSIGNED NOT NULL,
`id_country` INT UNSIGNED NOT NULL,
`id_group` INT UNSIGNED NOT NULL,
`id_customer` INT UNSIGNED NOT NULL,
`id_product_attribute` INT UNSIGNED NOT NULL,
`price` DECIMAL(20, 6) NOT NULL,
`from_quantity` mediumint(8) UNSIGNED NOT NULL,
`reduction` DECIMAL(20, 6) NOT NULL,
`reduction_tax` tinyint(1) NOT NULL DEFAULT 1,
`reduction_type` ENUM('amount', 'percentage') NOT NULL,
`from` DATETIME NOT NULL,
`to` DATETIME NOT NULL,
PRIMARY KEY (`id_specific_price`),
KEY (`id_product`, `id_shop`, `id_currency`, `id_country`, `id_group`, `id_customer`, `from_quantity`, `from`, `to`),
KEY `from_quantity` (`from_quantity`),
KEY (`id_specific_price_rule`),
KEY (`id_cart`),
KEY `id_product_attribute` (`id_product_attribute`),
KEY `id_shop` (`id_shop`),
KEY `id_customer` (`id_customer`),
KEY `from` (`from`),
KEY `to` (`to`),
UNIQUE KEY `id_product_2` (`id_product`,`id_product_attribute`,`id_customer`,`id_cart`,`from`,`to`,`id_shop`,`id_shop_group`,`id_currency`,`id_country`,`id_group`,`from_quantity`,`id_specific_price_rule`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `state` (
`id_state` int(10) unsigned NOT NULL auto_increment,
`id_country` int(11) unsigned NOT NULL,
`id_zone` int(11) unsigned NOT NULL,
`name` varchar(64) NOT NULL,
`iso_code` varchar(7) NOT NULL,
`tax_behavior` smallint(1) NOT NULL DEFAULT '0',
`active` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_state`),
KEY `id_country` (`id_country`),
KEY `name` (`name`),
KEY `id_zone` (`id_zone`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `supplier` (
`id_supplier` int(10) unsigned NOT NULL auto_increment,
`name` varchar(64) NOT NULL,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_supplier`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `supplier_lang` (
`id_supplier` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`description` text,
`meta_title` varchar(128) DEFAULT NULL,
`meta_keywords` varchar(255) DEFAULT NULL,
`meta_description` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id_supplier`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `tag` (
`id_tag` int(10) unsigned NOT NULL auto_increment,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(32) NOT NULL,
PRIMARY KEY (`id_tag`),
KEY `tag_name` (`name`),
KEY `id_lang` (`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `tag_count` (
`id_group` int(10) unsigned NOT NULL DEFAULT 0,
`id_tag` int(10) unsigned NOT NULL DEFAULT 0,
`id_lang` int(10) unsigned NOT NULL DEFAULT 0,
`id_shop` int(11) unsigned NOT NULL DEFAULT 0,
`counter` int(10) unsigned NOT NULL DEFAULT 0,
PRIMARY KEY (`id_group`, `id_tag`),
KEY (`id_group`, `id_lang`, `id_shop`, `counter`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `tax` (
`id_tax` int(10) unsigned NOT NULL auto_increment,
`rate` DECIMAL(10, 3) NOT NULL,
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
`deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id_tax`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `tax_lang` (
`id_tax` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(32) NOT NULL,
PRIMARY KEY (`id_tax`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `zone` (
`id_zone` int(10) unsigned NOT NULL auto_increment,
`name` varchar(64) NOT NULL,
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id_zone`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `carrier_group` (
`id_carrier` int(10) unsigned NOT NULL,
`id_group` int(10) unsigned NOT NULL,
PRIMARY KEY (`id_carrier`,`id_group`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `store` (
`id_store` int(10) unsigned NOT NULL AUTO_INCREMENT,
`id_country` int(10) unsigned NOT NULL,
`id_state` int(10) unsigned DEFAULT NULL,
`name` varchar(128) NOT NULL,
`address1` varchar(128) NOT NULL,
`address2` varchar(128) DEFAULT NULL,
`city` varchar(64) NOT NULL,
`postcode` varchar(12) NOT NULL,
`latitude` decimal(13,8) DEFAULT NULL,
`longitude` decimal(13,8) DEFAULT NULL,
`hours` varchar(254) DEFAULT NULL,
`phone` varchar(16) DEFAULT NULL,
`fax` varchar(16) DEFAULT NULL,
`email` varchar(128) DEFAULT NULL,
`note` text,
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
PRIMARY KEY (`id_store`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `required_field` (
`id_required_field` int(11) NOT NULL AUTO_INCREMENT,
`object_name` varchar(32) NOT NULL,
`field_name` varchar(32) NOT NULL,
PRIMARY KEY (`id_required_field`),
KEY `object_name` (`object_name`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `product_country_tax` (
`id_product` int(11) NOT NULL,
`id_country` int(11) NOT NULL,
`id_tax` int(11) NOT NULL,
PRIMARY KEY (`id_product`,`id_country`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `tax_rule` (
`id_tax_rule` int(11) NOT NULL AUTO_INCREMENT,
`id_tax_rules_group` int(11) NOT NULL,
`id_country` int(11) NOT NULL,
`id_state` int(11) NOT NULL,
`zipcode_from` VARCHAR(12) NOT NULL,
`zipcode_to` VARCHAR(12) NOT NULL,
`id_tax` int(11) NOT NULL,
`behavior` int(11) NOT NULL,
`description` VARCHAR( 100 ) NOT NULL,
PRIMARY KEY (`id_tax_rule`),
KEY `id_tax_rules_group` (`id_tax_rules_group`),
KEY `id_tax` (`id_tax`),
KEY `category_getproducts` ( `id_tax_rules_group` , `id_country` , `id_state` , `zipcode_from` )
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `tax_rules_group` (
`id_tax_rules_group` INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
`name` VARCHAR( 50 ) NOT NULL,
`active` INT NOT NULL,
`deleted` TINYINT(1) UNSIGNED NOT NULL,
`date_add` DATETIME NOT NULL,
`date_upd` DATETIME NOT NULL
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `specific_price_priority` (
`id_specific_price_priority` INT NOT NULL AUTO_INCREMENT ,
`id_product` INT NOT NULL ,
`priority` VARCHAR( 80 ) NOT NULL ,
PRIMARY KEY ( `id_specific_price_priority` , `id_product` ),
UNIQUE KEY `id_product` (`id_product`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `import_match` (
`id_import_match` int(10) NOT NULL AUTO_INCREMENT,
`name` varchar(32) NOT NULL,
`match` text NOT NULL,
`skip` int(2) NOT NULL,
PRIMARY KEY (`id_import_match`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE IF NOT EXISTS `shop_group` (
`id_shop_group` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(64) CHARACTER SET utf8 NOT NULL,
`share_customer` TINYINT(1) NOT NULL,
`share_order` TINYINT(1) NOT NULL,
`share_stock` TINYINT(1) NOT NULL,
`active` tinyint(1) NOT NULL DEFAULT '1',
`deleted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_shop_group`),
KEY `deleted` (`deleted`, `name`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE IF NOT EXISTS `shop` (
`id_shop` int(11) unsigned NOT NULL AUTO_INCREMENT,
`id_shop_group` int(11) unsigned NOT NULL,
`name` varchar(64) CHARACTER SET utf8 NOT NULL,
`id_category` INT(11) UNSIGNED NOT NULL DEFAULT '1',
`theme_name` varchar(255) NOT NULL DEFAULT '',
`active` tinyint(1) NOT NULL DEFAULT '1',
`deleted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id_shop`),
KEY `id_shop_group` (`id_shop_group`, `deleted`),
KEY `id_category` (`id_category`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE IF NOT EXISTS `shop_url` (
`id_shop_url` int(11) unsigned NOT NULL AUTO_INCREMENT,
`id_shop` int(11) unsigned NOT NULL,
`domain` varchar(150) NOT NULL,
`domain_ssl` varchar(150) NOT NULL,
`physical_uri` varchar(64) NOT NULL,
`virtual_uri` varchar(64) NOT NULL,
`main` TINYINT(1) NOT NULL,
`active` TINYINT(1) NOT NULL,
PRIMARY KEY (`id_shop_url`),
KEY `id_shop` (`id_shop`, `main`),
UNIQUE KEY `full_shop_url` (`domain`, `physical_uri`, `virtual_uri`),
UNIQUE KEY `full_shop_url_ssl` (`domain_ssl`, `physical_uri`, `virtual_uri`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `address_format` (
`id_country` int(10) unsigned NOT NULL,
`format` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id_country`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `stock_mvt` (
`id_stock_mvt` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT,
`id_stock` INT(11) UNSIGNED NOT NULL,
`id_order` INT(11) UNSIGNED DEFAULT NULL,
`id_supply_order` INT(11) UNSIGNED DEFAULT NULL,
`id_stock_mvt_reason` INT(11) UNSIGNED NOT NULL,
`id_employee` INT(11) UNSIGNED NOT NULL,
`employee_lastname` varchar(32) DEFAULT '',
`employee_firstname` varchar(32) DEFAULT '',
`physical_quantity` INT(11) UNSIGNED NOT NULL,
`date_add` DATETIME NOT NULL,
`sign` tinyint(1) NOT NULL DEFAULT 1,
`price_te` DECIMAL(20,6) DEFAULT '0.000000',
`last_wa` DECIMAL(20,6) DEFAULT '0.000000',
`current_wa` DECIMAL(20,6) DEFAULT '0.000000',
`referer` bigint UNSIGNED DEFAULT NULL,
PRIMARY KEY (`id_stock_mvt`),
KEY `id_stock` (`id_stock`),
KEY `id_stock_mvt_reason` (`id_stock_mvt_reason`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `stock_mvt_reason` (
`id_stock_mvt_reason` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`sign` tinyint(1) NOT NULL DEFAULT 1,
`date_add` datetime NOT NULL,
`date_upd` datetime NOT NULL,
`deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id_stock_mvt_reason`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `stock_mvt_reason_lang` (
`id_stock_mvt_reason` INT(11) UNSIGNED NOT NULL,
`id_lang` INT(11) UNSIGNED NOT NULL,
`name` VARCHAR(255) CHARACTER SET utf8 NOT NULL,
PRIMARY KEY (`id_stock_mvt_reason`,`id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `stock` (
`id_stock` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_warehouse` INT(11) UNSIGNED NOT NULL,
`id_product` INT(11) UNSIGNED NOT NULL,
`id_product_attribute` INT(11) UNSIGNED NOT NULL,
`reference` VARCHAR(32) NOT NULL,
`ean13` VARCHAR(13) DEFAULT NULL,
`isbn` VARCHAR(13) DEFAULT NULL,
`upc` VARCHAR(12) DEFAULT NULL,
`physical_quantity` INT(11) UNSIGNED NOT NULL,
`usable_quantity` INT(11) UNSIGNED NOT NULL,
`price_te` DECIMAL(20,6) DEFAULT '0.000000',
PRIMARY KEY (`id_stock`),
KEY `id_warehouse` (`id_warehouse`),
KEY `id_product` (`id_product`),
KEY `id_product_attribute` (`id_product_attribute`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `warehouse` (
`id_warehouse` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_currency` INT(11) UNSIGNED NOT NULL,
`id_address` INT(11) UNSIGNED NOT NULL,
`id_employee` INT(11) UNSIGNED NOT NULL,
`reference` VARCHAR(32) DEFAULT NULL,
`name` VARCHAR(45) NOT NULL,
`management_type` ENUM('WA', 'FIFO', 'LIFO') NOT NULL DEFAULT 'WA',
`deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id_warehouse`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `warehouse_product_location` (
`id_warehouse_product_location` int(11) unsigned NOT NULL AUTO_INCREMENT,
`id_product` int(11) unsigned NOT NULL,
`id_product_attribute` int(11) unsigned NOT NULL,
`id_warehouse` int(11) unsigned NOT NULL,
`location` varchar(64) DEFAULT NULL,
PRIMARY KEY (`id_warehouse_product_location`),
UNIQUE KEY `id_product` (`id_product`,`id_product_attribute`,`id_warehouse`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `warehouse_shop` (
`id_shop` INT(11) UNSIGNED NOT NULL,
`id_warehouse` INT(11) UNSIGNED NOT NULL,
PRIMARY KEY (`id_warehouse`, `id_shop`),
KEY `id_warehouse` (`id_warehouse`),
KEY `id_shop` (`id_shop`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `warehouse_carrier` (
`id_carrier` INT(11) UNSIGNED NOT NULL,
`id_warehouse` INT(11) UNSIGNED NOT NULL,
PRIMARY KEY (`id_warehouse`, `id_carrier`),
KEY `id_warehouse` (`id_warehouse`),
KEY `id_carrier` (`id_carrier`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `stock_available` (
`id_stock_available` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_product` INT(11) UNSIGNED NOT NULL,
`id_product_attribute` INT(11) UNSIGNED NOT NULL,
`id_shop` INT(11) UNSIGNED NOT NULL,
`id_shop_group` INT(11) UNSIGNED NOT NULL,
`quantity` INT(10) NOT NULL DEFAULT '0',
`depends_on_stock` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`out_of_stock` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (`id_stock_available`),
KEY `id_shop` (`id_shop`),
KEY `id_shop_group` (`id_shop_group`),
KEY `id_product` (`id_product`),
KEY `id_product_attribute` (`id_product_attribute`),
UNIQUE `product_sqlstock` (`id_product` , `id_product_attribute` , `id_shop`, `id_shop_group`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `supply_order` (
`id_supply_order` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_supplier` INT(11) UNSIGNED NOT NULL,
`supplier_name` VARCHAR(64) NOT NULL,
`id_lang` INT(11) UNSIGNED NOT NULL,
`id_warehouse` INT(11) UNSIGNED NOT NULL,
`id_supply_order_state` INT(11) UNSIGNED NOT NULL,
`id_currency` INT(11) UNSIGNED NOT NULL,
`id_ref_currency` INT(11) UNSIGNED NOT NULL,
`reference` VARCHAR(64) NOT NULL,
`date_add` DATETIME NOT NULL,
`date_upd` DATETIME NOT NULL,
`date_delivery_expected` DATETIME DEFAULT NULL,
`total_te` DECIMAL(20,6) DEFAULT '0.000000',
`total_with_discount_te` DECIMAL(20,6) DEFAULT '0.000000',
`total_tax` DECIMAL(20,6) DEFAULT '0.000000',
`total_ti` DECIMAL(20,6) DEFAULT '0.000000',
`discount_rate` DECIMAL(20,6) DEFAULT '0.000000',
`discount_value_te` DECIMAL(20,6) DEFAULT '0.000000',
`is_template` tinyint(1) DEFAULT '0',
PRIMARY KEY (`id_supply_order`),
KEY `id_supplier` (`id_supplier`),
KEY `id_warehouse` (`id_warehouse`),
KEY `reference` (`reference`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `supply_order_detail` (
`id_supply_order_detail` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_supply_order` INT(11) UNSIGNED NOT NULL,
`id_currency` INT(11) UNSIGNED NOT NULL,
`id_product` INT(11) UNSIGNED NOT NULL,
`id_product_attribute` INT(11) UNSIGNED NOT NULL,
`reference` VARCHAR(32) NOT NULL,
`supplier_reference` VARCHAR(32) NOT NULL,
`name` varchar(128) NOT NULL,
`ean13` VARCHAR(13) DEFAULT NULL,
`isbn` VARCHAR(13) DEFAULT NULL,
`upc` VARCHAR(12) DEFAULT NULL,
`exchange_rate` DECIMAL(20,6) DEFAULT '0.000000',
`unit_price_te` DECIMAL(20,6) DEFAULT '0.000000',
`quantity_expected` INT(11) UNSIGNED NOT NULL,
`quantity_received` INT(11) UNSIGNED NOT NULL,
`price_te` DECIMAL(20,6) DEFAULT '0.000000',
`discount_rate` DECIMAL(20,6) DEFAULT '0.000000',
`discount_value_te` DECIMAL(20,6) DEFAULT '0.000000',
`price_with_discount_te` DECIMAL(20,6) DEFAULT '0.000000',
`tax_rate` DECIMAL(20,6) DEFAULT '0.000000',
`tax_value` DECIMAL(20,6) DEFAULT '0.000000',
`price_ti` DECIMAL(20,6) DEFAULT '0.000000',
`tax_value_with_order_discount` DECIMAL(20,6) DEFAULT '0.000000',
`price_with_order_discount_te` DECIMAL(20,6) DEFAULT '0.000000',
PRIMARY KEY (`id_supply_order_detail`),
KEY `id_supply_order` (`id_supply_order`, `id_product`),
KEY `id_product_attribute` (`id_product_attribute`),
KEY `id_product_product_attribute` (`id_product`, `id_product_attribute`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `supply_order_history` (
`id_supply_order_history` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_supply_order` INT(11) UNSIGNED NOT NULL,
`id_employee` INT(11) UNSIGNED NOT NULL,
`employee_lastname` varchar(32) DEFAULT '',
`employee_firstname` varchar(32) DEFAULT '',
`id_state` INT(11) UNSIGNED NOT NULL,
`date_add` DATETIME NOT NULL,
PRIMARY KEY (`id_supply_order_history`),
KEY `id_supply_order` (`id_supply_order`),
KEY `id_employee` (`id_employee`),
KEY `id_state` (`id_state`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `supply_order_state` (
`id_supply_order_state` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`delivery_note` tinyint(1) NOT NULL DEFAULT '0',
`editable` tinyint(1) NOT NULL DEFAULT '0',
`receipt_state` tinyint(1) NOT NULL DEFAULT '0',
`pending_receipt` tinyint(1) NOT NULL DEFAULT '0',
`enclosed` tinyint(1) NOT NULL DEFAULT '0',
`color` VARCHAR(32) DEFAULT NULL,
PRIMARY KEY (`id_supply_order_state`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `supply_order_state_lang` (
`id_supply_order_state` INT(11) UNSIGNED NOT NULL,
`id_lang` INT(11) UNSIGNED NOT NULL,
`name` VARCHAR(128) DEFAULT NULL,
PRIMARY KEY (`id_supply_order_state`, `id_lang`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `supply_order_receipt_history` (
`id_supply_order_receipt_history` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_supply_order_detail` INT(11) UNSIGNED NOT NULL,
`id_employee` INT(11) UNSIGNED NOT NULL,
`employee_lastname` varchar(32) DEFAULT '',
`employee_firstname` varchar(32) DEFAULT '',
`id_supply_order_state` INT(11) UNSIGNED NOT NULL,
`quantity` INT(11) UNSIGNED NOT NULL,
`date_add` DATETIME NOT NULL,
PRIMARY KEY (`id_supply_order_receipt_history`),
KEY `id_supply_order_detail` (`id_supply_order_detail`),
KEY `id_supply_order_state` (`id_supply_order_state`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `product_supplier` (
`id_product_supplier` int(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_product` int(11) UNSIGNED NOT NULL,
`id_product_attribute` int(11) UNSIGNED NOT NULL DEFAULT '0',
`id_supplier` int(11) UNSIGNED NOT NULL,
`product_supplier_reference` varchar(32) DEFAULT NULL,
`product_supplier_price_te` decimal(20,6) NOT NULL DEFAULT '0.000000',
`id_currency` int(11) unsigned NOT NULL,
PRIMARY KEY (`id_product_supplier`),
UNIQUE KEY `id_product` (`id_product`,`id_product_attribute`,`id_supplier`),
KEY `id_supplier` (`id_supplier`,`id_product`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_carrier` (
`id_order_carrier` int(11) NOT NULL AUTO_INCREMENT,
`id_order` int(11) unsigned NOT NULL,
`id_carrier` int(11) unsigned NOT NULL,
`id_order_invoice` int(11) unsigned DEFAULT NULL,
`weight` DECIMAL(20,6) DEFAULT NULL,
`shipping_cost_tax_excl` decimal(20,6) DEFAULT NULL,
`shipping_cost_tax_incl` decimal(20,6) DEFAULT NULL,
`tracking_number` varchar(64) DEFAULT NULL,
`date_add` datetime NOT NULL,
PRIMARY KEY (`id_order_carrier`),
KEY `id_order` (`id_order`),
KEY `id_carrier` (`id_carrier`),
KEY `id_order_invoice` (`id_order_invoice`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE IF NOT EXISTS `specific_price_rule` (
`id_specific_price_rule` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` VARCHAR(255) NOT NULL,
`id_shop` int(11) unsigned NOT NULL DEFAULT '1',
`id_currency` int(10) unsigned NOT NULL,
`id_country` int(10) unsigned NOT NULL,
`id_group` int(10) unsigned NOT NULL,
`from_quantity` mediumint(8) unsigned NOT NULL,
`price` DECIMAL(20,6),
`reduction` decimal(20,6) NOT NULL,
`reduction_tax` tinyint(1) NOT NULL DEFAULT 1,
`reduction_type` enum('amount','percentage') NOT NULL,
`from` datetime NOT NULL,
`to` datetime NOT NULL,
PRIMARY KEY (`id_specific_price_rule`),
KEY `id_product` (`id_shop`,`id_currency`,`id_country`,`id_group`,`from_quantity`,`from`,`to`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `specific_price_rule_condition_group` (
`id_specific_price_rule_condition_group` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_specific_price_rule` INT(11) UNSIGNED NOT NULL,
PRIMARY KEY ( `id_specific_price_rule_condition_group`, `id_specific_price_rule` )
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `specific_price_rule_condition` (
`id_specific_price_rule_condition` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`id_specific_price_rule_condition_group` INT(11) UNSIGNED NOT NULL,
`type` VARCHAR(255) NOT NULL,
`value` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id_specific_price_rule_condition`),
INDEX (`id_specific_price_rule_condition_group`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE IF NOT EXISTS `risk` (
`id_risk` int(11) unsigned NOT NULL AUTO_INCREMENT,
`percent` tinyint(3) NOT NULL,
`color` varchar(32) NULL,
PRIMARY KEY (`id_risk`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE IF NOT EXISTS `risk_lang` (
`id_risk` int(10) unsigned NOT NULL,
`id_lang` int(10) unsigned NOT NULL,
`name` varchar(20) NOT NULL,
PRIMARY KEY (`id_risk`,`id_lang`),
KEY `id_risk` (`id_risk`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `category_shop` (
`id_category` int(11) NOT NULL,
`id_shop` int(11) NOT NULL,
`position` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id_category`, `id_shop`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `carrier_tax_rules_group_shop` (
`id_carrier` int( 11 ) unsigned NOT NULL,
`id_tax_rules_group` int(11) unsigned NOT NULL,
`id_shop` int(11) unsigned NOT NULL,
PRIMARY KEY (`id_carrier`, `id_tax_rules_group`, `id_shop`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE `order_invoice_payment` (
`id_order_invoice` int(11) unsigned NOT NULL,
`id_order_payment` int(11) unsigned NOT NULL,
`id_order` int(11) unsigned NOT NULL,
PRIMARY KEY (`id_order_invoice`,`id_order_payment`),
KEY `order_payment` (`id_order_payment`),
KEY `id_order` (`id_order`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
CREATE TABLE IF NOT EXISTS `order_slip_detail_tax` (
`id_order_slip_detail` int(11) unsigned NOT NULL,
`id_tax` int(11) unsigned NOT NULL,
`unit_amount` decimal(16,6) NOT NULL DEFAULT '0.000000',
`total_amount` decimal(16,6) NOT NULL DEFAULT '0.000000',
KEY (`id_order_slip_detail`),
KEY `id_tax` (`id_tax`)
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 COLLATION;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment