-- MySQL dump 10.13 Distrib 5.5.13, for Linux (x86_64)
--
-- Host: localhost Database: reverse_1_4_0_1
-- ------------------------------------------------------
-- Server version 5.5.13

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `admin_assert`
--

DROP TABLE IF EXISTS `admin_assert`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_assert` (
`assert_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`assert_type` varchar(20) NOT NULL DEFAULT '',
`assert_data` text,
PRIMARY KEY (`assert_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='ACL Asserts';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `admin_role`
--

DROP TABLE IF EXISTS `admin_role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_role` (
`role_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`parent_id` int(10) unsigned NOT NULL DEFAULT '0',
`tree_level` tinyint(3) unsigned NOT NULL DEFAULT '0',
`sort_order` tinyint(3) unsigned NOT NULL DEFAULT '0',
`role_type` char(1) NOT NULL DEFAULT '0',
`user_id` int(11) unsigned NOT NULL DEFAULT '0',
`role_name` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`role_id`),
KEY `parent_id` (`parent_id`,`sort_order`),
KEY `tree_level` (`tree_level`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='ACL Roles';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `admin_rule`
--

DROP TABLE IF EXISTS `admin_rule`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_rule` (
`rule_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`role_id` int(10) unsigned NOT NULL DEFAULT '0',
`resource_id` varchar(255) NOT NULL DEFAULT '',
`privileges` varchar(20) NOT NULL DEFAULT '',
`assert_id` int(10) unsigned NOT NULL DEFAULT '0',
`role_type` char(1) DEFAULT NULL,
`permission` varchar(10) DEFAULT NULL,
PRIMARY KEY (`rule_id`),
KEY `resource` (`resource_id`,`role_id`),
KEY `role_id` (`role_id`,`resource_id`),
CONSTRAINT `FK_admin_rule` FOREIGN KEY (`role_id`) REFERENCES `admin_role` (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='ACL Rules';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `admin_user`
--

DROP TABLE IF EXISTS `admin_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_user` (
`user_id` mediumint(9) unsigned NOT NULL AUTO_INCREMENT,
`firstname` varchar(32) NOT NULL DEFAULT '',
`lastname` varchar(32) NOT NULL DEFAULT '',
`email` varchar(128) NOT NULL DEFAULT '',
`username` varchar(40) NOT NULL DEFAULT '',
`password` varchar(40) NOT NULL DEFAULT '',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` datetime DEFAULT NULL,
`logdate` datetime DEFAULT NULL,
`lognum` smallint(5) unsigned NOT NULL DEFAULT '0',
`reload_acl_flag` tinyint(1) NOT NULL DEFAULT '0',
`is_active` tinyint(1) NOT NULL DEFAULT '1',
`extra` text,
PRIMARY KEY (`user_id`),
UNIQUE KEY `UNQ_ADMIN_USER_USERNAME` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Users';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `adminnotification_inbox`
--

DROP TABLE IF EXISTS `adminnotification_inbox`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `adminnotification_inbox` (
`notification_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`severity` tinyint(3) unsigned NOT NULL DEFAULT '0',
`date_added` datetime NOT NULL,
`title` varchar(255) NOT NULL,
`description` text,
`url` varchar(255) NOT NULL,
`is_read` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_remove` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`notification_id`),
KEY `IDX_SEVERITY` (`severity`),
KEY `IDX_IS_READ` (`is_read`),
KEY `IDX_IS_REMOVE` (`is_remove`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `api_assert`
--

DROP TABLE IF EXISTS `api_assert`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `api_assert` (
`assert_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`assert_type` varchar(20) NOT NULL DEFAULT '',
`assert_data` text,
PRIMARY KEY (`assert_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Api ACL Asserts';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `api_role`
--

DROP TABLE IF EXISTS `api_role`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `api_role` (
`role_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`parent_id` int(10) unsigned NOT NULL DEFAULT '0',
`tree_level` tinyint(3) unsigned NOT NULL DEFAULT '0',
`sort_order` tinyint(3) unsigned NOT NULL DEFAULT '0',
`role_type` char(1) NOT NULL DEFAULT '0',
`user_id` int(11) unsigned NOT NULL DEFAULT '0',
`role_name` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`role_id`),
KEY `parent_id` (`parent_id`,`sort_order`),
KEY `tree_level` (`tree_level`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Api ACL Roles';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `api_rule`
--

DROP TABLE IF EXISTS `api_rule`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `api_rule` (
`rule_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`role_id` int(10) unsigned NOT NULL DEFAULT '0',
`resource_id` varchar(255) NOT NULL DEFAULT '',
`privileges` varchar(20) NOT NULL DEFAULT '',
`assert_id` int(10) unsigned NOT NULL DEFAULT '0',
`role_type` char(1) DEFAULT NULL,
`permission` varchar(10) DEFAULT NULL,
PRIMARY KEY (`rule_id`),
KEY `resource` (`resource_id`,`role_id`),
KEY `role_id` (`role_id`,`resource_id`),
CONSTRAINT `FK_api_rule` FOREIGN KEY (`role_id`) REFERENCES `api_role` (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Api ACL Rules';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `api_session`
--

DROP TABLE IF EXISTS `api_session`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `api_session` (
`user_id` mediumint(9) unsigned NOT NULL,
`logdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`sessid` varchar(40) NOT NULL DEFAULT '',
KEY `API_SESSION_USER` (`user_id`),
KEY `API_SESSION_SESSID` (`sessid`),
CONSTRAINT `FK_API_SESSION_USER` FOREIGN KEY (`user_id`) REFERENCES `api_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Api Sessions';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `api_user`
--

DROP TABLE IF EXISTS `api_user`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `api_user` (
`user_id` mediumint(9) unsigned NOT NULL AUTO_INCREMENT,
`firstname` varchar(32) NOT NULL DEFAULT '',
`lastname` varchar(32) NOT NULL DEFAULT '',
`email` varchar(128) NOT NULL DEFAULT '',
`username` varchar(40) NOT NULL DEFAULT '',
`api_key` varchar(40) NOT NULL DEFAULT '',
`created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`modified` datetime DEFAULT NULL,
`lognum` smallint(5) unsigned NOT NULL DEFAULT '0',
`reload_acl_flag` tinyint(1) NOT NULL DEFAULT '0',
`is_active` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Api Users';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_category_entity`
--

DROP TABLE IF EXISTS `catalog_category_entity`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_category_entity` (
`entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_set_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`parent_id` int(10) unsigned NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`path` varchar(255) NOT NULL,
`position` int(11) NOT NULL,
`level` int(11) NOT NULL,
`children_count` int(11) NOT NULL,
PRIMARY KEY (`entity_id`),
KEY `IDX_LEVEL` (`level`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='Category Entities';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_category_entity_datetime`
--

DROP TABLE IF EXISTS `catalog_category_entity_datetime`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_category_entity_datetime` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` datetime DEFAULT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`),
KEY `FK_ATTRIBUTE_DATETIME_ENTITY` (`entity_id`),
KEY `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOG_CATEGORY_ENTITY_DATETIME_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DATETIME_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DATETIME_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_category_entity_decimal`
--

DROP TABLE IF EXISTS `catalog_category_entity_decimal`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_category_entity_decimal` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` decimal(12,4) DEFAULT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`),
KEY `FK_ATTRIBUTE_DECIMAL_ENTITY` (`entity_id`),
KEY `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_DECIMAL_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_category_entity_int`
--

DROP TABLE IF EXISTS `catalog_category_entity_int`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_category_entity_int` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` int(11) DEFAULT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`),
KEY `FK_ATTRIBUTE_INT_ENTITY` (`entity_id`),
KEY `FK_CATALOG_CATEGORY_EMTITY_INT_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOG_CATEGORY_EMTITY_INT_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_CATEGORY_EMTITY_INT_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_category_entity_text`
--

DROP TABLE IF EXISTS `catalog_category_entity_text`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_category_entity_text` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` text NOT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`),
KEY `FK_ATTRIBUTE_TEXT_ENTITY` (`entity_id`),
KEY `FK_CATALOG_CATEGORY_ENTITY_TEXT_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOG_CATEGORY_ENTITY_TEXT_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_TEXT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_TEXT_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_category_entity_varchar`
--

DROP TABLE IF EXISTS `catalog_category_entity_varchar`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_category_entity_varchar` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`) USING BTREE,
KEY `FK_ATTRIBUTE_VARCHAR_ENTITY` (`entity_id`),
KEY `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_category_product`
--

DROP TABLE IF EXISTS `catalog_category_product`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_category_product` (
`category_id` int(10) unsigned NOT NULL DEFAULT '0',
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`position` int(10) NOT NULL DEFAULT '0',
UNIQUE KEY `UNQ_CATEGORY_PRODUCT` (`category_id`,`product_id`),
KEY `CATALOG_CATEGORY_PRODUCT_CATEGORY` (`category_id`),
KEY `CATALOG_CATEGORY_PRODUCT_PRODUCT` (`product_id`),
CONSTRAINT `CATALOG_CATEGORY_PRODUCT_CATEGORY` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `CATALOG_CATEGORY_PRODUCT_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_category_product_index`
--

DROP TABLE IF EXISTS `catalog_category_product_index`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_category_product_index` (
`category_id` int(10) unsigned NOT NULL DEFAULT '0',
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`position` int(10) NOT NULL DEFAULT '0',
`is_parent` tinyint(1) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`visibility` tinyint(3) unsigned NOT NULL,
UNIQUE KEY `UNQ_CATEGORY_PRODUCT` (`category_id`,`product_id`,`store_id`),
KEY `FK_CATALOG_CATEGORY_PRODUCT_INDEX_CATEGORY_ENTITY` (`category_id`),
KEY `IDX_JOIN` (`product_id`,`store_id`,`category_id`,`visibility`),
KEY `IDX_BASE` (`store_id`,`category_id`,`visibility`,`is_parent`,`position`),
CONSTRAINT `FK_CATALOG_CATEGORY_PRODUCT_INDEX_CATEGORY_ENTITY` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_CATEGORY_PRODUCT_INDEX_PRODUCT_ENTITY` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATEGORY_PRODUCT_INDEX_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_compare_item`
--

DROP TABLE IF EXISTS `catalog_compare_item`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_compare_item` (
`catalog_compare_item_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`visitor_id` int(11) unsigned NOT NULL DEFAULT '0',
`customer_id` int(11) unsigned DEFAULT NULL,
`product_id` int(11) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned DEFAULT NULL,
PRIMARY KEY (`catalog_compare_item_id`),
KEY `FK_CATALOG_COMPARE_ITEM_CUSTOMER` (`customer_id`),
KEY `FK_CATALOG_COMPARE_ITEM_PRODUCT` (`product_id`),
KEY `IDX_VISITOR_PRODUCTS` (`visitor_id`,`product_id`),
KEY `IDX_CUSTOMER_PRODUCTS` (`customer_id`,`product_id`),
KEY `FK_CATALOG_COMPARE_ITEM_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_COMPARE_ITEM_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_COMPARE_ITEM_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_COMPARE_ITEM_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_eav_attribute`
--

DROP TABLE IF EXISTS `catalog_eav_attribute`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_eav_attribute` (
`attribute_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`frontend_input_renderer` varchar(255) DEFAULT NULL,
`is_global` tinyint(1) unsigned NOT NULL DEFAULT '1',
`is_visible` tinyint(1) unsigned NOT NULL DEFAULT '1',
`is_searchable` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_filterable` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_comparable` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_visible_on_front` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_html_allowed_on_front` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_used_for_price_rules` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_filterable_in_search` tinyint(1) unsigned NOT NULL DEFAULT '0',
`used_in_product_listing` tinyint(1) unsigned NOT NULL DEFAULT '0',
`used_for_sort_by` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_configurable` tinyint(1) unsigned NOT NULL DEFAULT '1',
`apply_to` varchar(255) NOT NULL,
`is_visible_in_advanced_search` tinyint(1) unsigned NOT NULL DEFAULT '0',
`position` int(11) NOT NULL,
`is_wysiwyg_enabled` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`attribute_id`),
KEY `IDX_USED_FOR_SORT_BY` (`used_for_sort_by`),
KEY `IDX_USED_IN_PRODUCT_LISTING` (`used_in_product_listing`),
CONSTRAINT `FK_CATALOG_EAV_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=507 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_bundle_option`
--

DROP TABLE IF EXISTS `catalog_product_bundle_option`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_bundle_option` (
`option_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`parent_id` int(10) unsigned NOT NULL,
`required` tinyint(1) unsigned NOT NULL DEFAULT '0',
`position` int(10) unsigned NOT NULL DEFAULT '0',
`type` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`option_id`),
KEY `FK_CATALOG_PRODUCT_BUNDLE_OPTION_PARENT` (`parent_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_BUNDLE_OPTION_PARENT` FOREIGN KEY (`parent_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bundle Options';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_bundle_option_value`
--

DROP TABLE IF EXISTS `catalog_product_bundle_option_value`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_bundle_option_value` (
`value_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`option_id` int(10) unsigned NOT NULL,
`store_id` smallint(5) unsigned NOT NULL,
`title` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`value_id`),
UNIQUE KEY `UNQ_OPTION_STORE` (`option_id`,`store_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_BUNDLE_OPTION_VALUE_OPTION` FOREIGN KEY (`option_id`) REFERENCES `catalog_product_bundle_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bundle Selections';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_bundle_price_index`
--

DROP TABLE IF EXISTS `catalog_product_bundle_price_index`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_bundle_price_index` (
`entity_id` int(10) unsigned NOT NULL,
`website_id` smallint(5) unsigned NOT NULL,
`customer_group_id` smallint(3) unsigned NOT NULL,
`min_price` decimal(12,4) NOT NULL,
`max_price` decimal(12,4) NOT NULL,
PRIMARY KEY (`entity_id`,`website_id`,`customer_group_id`),
KEY `IDX_WEBSITE` (`website_id`),
KEY `IDX_CUSTOMER_GROUP` (`customer_group_id`),
CONSTRAINT `CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_CUSTOMER_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_bundle_selection`
--

DROP TABLE IF EXISTS `catalog_product_bundle_selection`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_bundle_selection` (
`selection_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`option_id` int(10) unsigned NOT NULL,
`parent_product_id` int(10) unsigned NOT NULL,
`product_id` int(10) unsigned NOT NULL,
`position` int(10) unsigned NOT NULL DEFAULT '0',
`is_default` tinyint(1) unsigned NOT NULL DEFAULT '0',
`selection_price_type` tinyint(1) unsigned NOT NULL DEFAULT '0',
`selection_price_value` decimal(12,4) NOT NULL DEFAULT '0.0000',
`selection_qty` decimal(12,4) NOT NULL DEFAULT '0.0000',
`selection_can_change_qty` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`selection_id`),
KEY `FK_CATALOG_PRODUCT_BUNDLE_SELECTION_OPTION` (`option_id`),
KEY `FK_CATALOG_PRODUCT_BUNDLE_SELECTION_PRODUCT` (`product_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_BUNDLE_SELECTION_OPTION` FOREIGN KEY (`option_id`) REFERENCES `catalog_product_bundle_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_BUNDLE_SELECTION_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bundle Selections';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_bundle_stock_index`
--

DROP TABLE IF EXISTS `catalog_product_bundle_stock_index`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_bundle_stock_index` (
`entity_id` int(10) unsigned NOT NULL,
`website_id` smallint(5) unsigned NOT NULL,
`stock_id` smallint(5) unsigned NOT NULL,
`option_id` int(10) unsigned NOT NULL DEFAULT '0',
`stock_status` tinyint(1) DEFAULT '0',
PRIMARY KEY (`entity_id`,`stock_id`,`website_id`,`option_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_enabled_index`
--

DROP TABLE IF EXISTS `catalog_product_enabled_index`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_enabled_index` (
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`visibility` smallint(5) unsigned NOT NULL DEFAULT '0',
UNIQUE KEY `UNQ_PRODUCT_STORE` (`product_id`,`store_id`),
KEY `IDX_PRODUCT_VISIBILITY_IN_STORE` (`product_id`,`store_id`,`visibility`),
KEY `FK_CATALOG_PRODUCT_ENABLED_INDEX_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_ENABLED_INDEX_PRODUCT_ENTITY` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENABLED_INDEX_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_entity`
--

DROP TABLE IF EXISTS `catalog_product_entity`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_entity` (
`entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_set_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`type_id` varchar(32) NOT NULL DEFAULT 'simple',
`sku` varchar(64) DEFAULT NULL,
`has_options` smallint(1) NOT NULL DEFAULT '0',
`required_options` tinyint(1) unsigned NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`entity_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_ATTRIBUTE_SET_ID` (`attribute_set_id`),
KEY `sku` (`sku`),
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_ATTRIBUTE_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Product Entities';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_entity_datetime`
--

DROP TABLE IF EXISTS `catalog_product_entity_datetime`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_entity_datetime` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` datetime DEFAULT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`,`store_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_DATETIME_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_DATETIME_STORE` (`store_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_DATETIME_PRODUCT_ENTITY` (`entity_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DATETIME_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DATETIME_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_entity_decimal`
--

DROP TABLE IF EXISTS `catalog_product_entity_decimal`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_entity_decimal` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` decimal(12,4) DEFAULT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`,`store_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_STORE` (`store_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_PRODUCT_ENTITY` (`entity_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_ATTRIBUTE` (`attribute_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_DECIMAL_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_entity_gallery`
--

DROP TABLE IF EXISTS `catalog_product_entity_gallery`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_entity_gallery` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`position` int(11) NOT NULL DEFAULT '0',
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_BASE` (`entity_type_id`,`entity_id`,`attribute_id`,`store_id`),
KEY `FK_ATTRIBUTE_GALLERY_ENTITY` (`entity_id`),
KEY `FK_CATALOG_CATEGORY_ENTITY_GALLERY_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOG_CATEGORY_ENTITY_GALLERY_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_GALLERY_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_GALLERY_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_GALLERY_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_entity_int`
--

DROP TABLE IF EXISTS `catalog_product_entity_int`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_entity_int` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` int(11) DEFAULT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`,`store_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_INT_STORE` (`store_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_INT_PRODUCT_ENTITY` (`entity_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_INT_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_INT_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_entity_media_gallery`
--

DROP TABLE IF EXISTS `catalog_product_entity_media_gallery`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_entity_media_gallery` (
`value_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` varchar(255) DEFAULT NULL,
PRIMARY KEY (`value_id`),
KEY `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ENTITY` (`entity_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog product media gallery';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_entity_media_gallery_value`
--

DROP TABLE IF EXISTS `catalog_product_entity_media_gallery_value`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_entity_media_gallery_value` (
`value_id` int(11) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`label` varchar(255) DEFAULT NULL,
`position` int(11) unsigned DEFAULT NULL,
`disabled` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`value_id`,`store_id`),
KEY `FK_CATALOG_PRODUCT_MEDIA_GALLERY_VALUE_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_VALUE_GALLERY` FOREIGN KEY (`value_id`) REFERENCES `catalog_product_entity_media_gallery` (`value_id`) ON DELETE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_MEDIA_GALLERY_VALUE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog product media gallery values';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_entity_text`
--

DROP TABLE IF EXISTS `catalog_product_entity_text`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_entity_text` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` text NOT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`,`store_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_TEXT_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_TEXT_STORE` (`store_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_TEXT_PRODUCT_ENTITY` (`entity_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TEXT_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TEXT_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_entity_tier_price`
--

DROP TABLE IF EXISTS `catalog_product_entity_tier_price`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_entity_tier_price` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`all_groups` tinyint(1) unsigned NOT NULL DEFAULT '1',
`customer_group_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`qty` decimal(12,4) NOT NULL DEFAULT '1.0000',
`value` decimal(12,4) NOT NULL DEFAULT '0.0000',
`website_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `UNQ_CATALOG_PRODUCT_TIER_PRICE` (`entity_id`,`all_groups`,`customer_group_id`,`qty`,`website_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_PRODUCT_ENTITY` (`entity_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_GROUP` (`customer_group_id`),
KEY `FK_CATALOG_PRODUCT_TIER_WEBSITE` (`website_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_TIER_PRICE_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_TIER_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_entity_varchar`
--

DROP TABLE IF EXISTS `catalog_product_entity_varchar`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_entity_varchar` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`,`store_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_STORE` (`store_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_PRODUCT_ENTITY` (`entity_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_VARCHAR_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_index_eav`
--

DROP TABLE IF EXISTS `catalog_product_index_eav`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_index_eav` (
`entity_id` int(10) unsigned NOT NULL,
`attribute_id` smallint(5) unsigned NOT NULL,
`store_id` smallint(5) unsigned NOT NULL,
`value` int(10) unsigned NOT NULL,
PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`),
KEY `IDX_ENTITY` (`entity_id`),
KEY `IDX_ATTRIBUTE` (`attribute_id`),
KEY `IDX_STORE` (`store_id`),
KEY `IDX_VALUE` (`value`),
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_EAV_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_EAV_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_EAV_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_index_eav_decimal`
--

DROP TABLE IF EXISTS `catalog_product_index_eav_decimal`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_index_eav_decimal` (
`entity_id` int(10) unsigned NOT NULL,
`attribute_id` smallint(5) unsigned NOT NULL,
`store_id` smallint(5) unsigned NOT NULL,
`value` decimal(12,4) NOT NULL,
PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`),
KEY `IDX_ENTITY` (`entity_id`),
KEY `IDX_ATTRIBUTE` (`attribute_id`),
KEY `IDX_STORE` (`store_id`),
KEY `IDX_VALUE` (`value`),
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_index_price`
--

DROP TABLE IF EXISTS `catalog_product_index_price`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_index_price` (
`entity_id` int(10) unsigned NOT NULL,
`customer_group_id` smallint(5) unsigned NOT NULL,
`website_id` smallint(5) unsigned NOT NULL,
`tax_class_id` smallint(5) unsigned DEFAULT '0',
`price` decimal(12,4) DEFAULT NULL,
`final_price` decimal(12,4) DEFAULT NULL,
`min_price` decimal(12,4) DEFAULT NULL,
`max_price` decimal(12,4) DEFAULT NULL,
`tier_price` decimal(12,4) DEFAULT NULL,
PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`),
KEY `IDX_CUSTOMER_GROUP` (`customer_group_id`),
KEY `IDX_WEBSITE` (`website_id`),
KEY `IDX_MIN_PRICE` (`min_price`),
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_PRICE_CUSTOMER_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_PRICE_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_PRICE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_index_tier_price`
--

DROP TABLE IF EXISTS `catalog_product_index_tier_price`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_index_tier_price` (
`entity_id` int(10) unsigned NOT NULL,
`customer_group_id` smallint(5) unsigned NOT NULL,
`website_id` smallint(5) unsigned NOT NULL,
`min_price` decimal(12,4) DEFAULT NULL,
PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`),
KEY `FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_CUSTOMER` (`customer_group_id`),
KEY `FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_WEBSITE` (`website_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_CUSTOMER` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_TIER_PRICE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_index_website`
--

DROP TABLE IF EXISTS `catalog_product_index_website`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_index_website` (
`website_id` smallint(5) unsigned NOT NULL,
`date` date DEFAULT NULL,
`rate` float(12,4) unsigned DEFAULT '1.0000',
PRIMARY KEY (`website_id`),
KEY `IDX_DATE` (`date`),
CONSTRAINT `FK_CATALOG_PRODUCT_INDEX_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_link`
--

DROP TABLE IF EXISTS `catalog_product_link`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_link` (
`link_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`linked_product_id` int(10) unsigned NOT NULL DEFAULT '0',
`link_type_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`link_id`),
KEY `FK_LINK_PRODUCT` (`product_id`),
KEY `FK_LINKED_PRODUCT` (`linked_product_id`),
KEY `FK_PRODUCT_LINK_TYPE` (`link_type_id`),
CONSTRAINT `FK_PRODUCT_LINK_LINKED_PRODUCT` FOREIGN KEY (`linked_product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_PRODUCT_LINK_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_PRODUCT_LINK_TYPE` FOREIGN KEY (`link_type_id`) REFERENCES `catalog_product_link_type` (`link_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Related products';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_link_attribute`
--

DROP TABLE IF EXISTS `catalog_product_link_attribute`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_link_attribute` (
`product_link_attribute_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
`link_type_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
`product_link_attribute_code` varchar(32) NOT NULL DEFAULT '',
`data_type` varchar(32) NOT NULL DEFAULT '',
PRIMARY KEY (`product_link_attribute_id`),
KEY `FK_ATTRIBUTE_PRODUCT_LINK_TYPE` (`link_type_id`),
CONSTRAINT `FK_ATTRIBUTE_PRODUCT_LINK_TYPE` FOREIGN KEY (`link_type_id`) REFERENCES `catalog_product_link_type` (`link_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='Attributes for product link';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_link_attribute_decimal`
--

DROP TABLE IF EXISTS `catalog_product_link_attribute_decimal`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_link_attribute_decimal` (
`value_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`product_link_attribute_id` smallint(6) unsigned DEFAULT NULL,
`link_id` int(11) unsigned DEFAULT NULL,
`value` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`value_id`),
KEY `FK_DECIMAL_PRODUCT_LINK_ATTRIBUTE` (`product_link_attribute_id`),
KEY `FK_DECIMAL_LINK` (`link_id`),
CONSTRAINT `FK_DECIMAL_LINK` FOREIGN KEY (`link_id`) REFERENCES `catalog_product_link` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_DECIMAL_PRODUCT_LINK_ATTRIBUTE` FOREIGN KEY (`product_link_attribute_id`) REFERENCES `catalog_product_link_attribute` (`product_link_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Decimal attributes values';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_link_attribute_int`
--

DROP TABLE IF EXISTS `catalog_product_link_attribute_int`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_link_attribute_int` (
`value_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`product_link_attribute_id` smallint(6) unsigned DEFAULT NULL,
`link_id` int(11) unsigned DEFAULT NULL,
`value` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`value_id`),
KEY `FK_INT_PRODUCT_LINK_ATTRIBUTE` (`product_link_attribute_id`),
KEY `FK_INT_PRODUCT_LINK` (`link_id`),
CONSTRAINT `FK_INT_PRODUCT_LINK` FOREIGN KEY (`link_id`) REFERENCES `catalog_product_link` (`link_id`) ON DELETE CASCADE,
CONSTRAINT `FK_INT_PRODUCT_LINK_ATTRIBUTE` FOREIGN KEY (`product_link_attribute_id`) REFERENCES `catalog_product_link_attribute` (`product_link_attribute_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_link_attribute_varchar`
--

DROP TABLE IF EXISTS `catalog_product_link_attribute_varchar`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_link_attribute_varchar` (
`value_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`product_link_attribute_id` smallint(6) unsigned NOT NULL DEFAULT '0',
`link_id` int(11) unsigned DEFAULT NULL,
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`value_id`),
KEY `FK_VARCHAR_PRODUCT_LINK_ATTRIBUTE` (`product_link_attribute_id`),
KEY `FK_VARCHAR_LINK` (`link_id`),
CONSTRAINT `FK_VARCHAR_LINK` FOREIGN KEY (`link_id`) REFERENCES `catalog_product_link` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_VARCHAR_PRODUCT_LINK_ATTRIBUTE` FOREIGN KEY (`product_link_attribute_id`) REFERENCES `catalog_product_link_attribute` (`product_link_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Varchar attributes values';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_link_type`
--

DROP TABLE IF EXISTS `catalog_product_link_type`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_link_type` (
`link_type_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
`code` varchar(32) NOT NULL DEFAULT '',
PRIMARY KEY (`link_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='Types of product link(Related, superproduct, bundles)';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_option`
--

DROP TABLE IF EXISTS `catalog_product_option`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_option` (
`option_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`type` varchar(50) NOT NULL DEFAULT '',
`is_require` tinyint(1) NOT NULL DEFAULT '1',
`sku` varchar(64) NOT NULL DEFAULT '',
`max_characters` int(10) unsigned DEFAULT NULL,
`file_extension` varchar(50) DEFAULT NULL,
`image_size_x` smallint(5) unsigned NOT NULL,
`image_size_y` smallint(5) unsigned NOT NULL,
`sort_order` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`option_id`),
KEY `CATALOG_PRODUCT_OPTION_PRODUCT` (`product_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_option_price`
--

DROP TABLE IF EXISTS `catalog_product_option_price`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_option_price` (
`option_price_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`option_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`price` decimal(12,4) NOT NULL DEFAULT '0.0000',
`price_type` enum('fixed','percent') NOT NULL DEFAULT 'fixed',
PRIMARY KEY (`option_price_id`),
UNIQUE KEY `UNQ_OPTION_STORE` (`option_id`,`store_id`),
KEY `CATALOG_PRODUCT_OPTION_PRICE_OPTION` (`option_id`),
KEY `CATALOG_PRODUCT_OPTION_TITLE_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_PRICE_OPTION` FOREIGN KEY (`option_id`) REFERENCES `catalog_product_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_PRICE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_option_title`
--

DROP TABLE IF EXISTS `catalog_product_option_title`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_option_title` (
`option_title_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`option_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`option_title_id`),
UNIQUE KEY `UNQ_OPTION_STORE` (`option_id`,`store_id`),
KEY `CATALOG_PRODUCT_OPTION_TITLE_OPTION` (`option_id`),
KEY `CATALOG_PRODUCT_OPTION_TITLE_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TITLE_OPTION` FOREIGN KEY (`option_id`) REFERENCES `catalog_product_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TITLE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_option_type_price`
--

DROP TABLE IF EXISTS `catalog_product_option_type_price`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_option_type_price` (
`option_type_price_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`option_type_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`price` decimal(12,4) NOT NULL DEFAULT '0.0000',
`price_type` enum('fixed','percent') NOT NULL DEFAULT 'fixed',
PRIMARY KEY (`option_type_price_id`),
UNIQUE KEY `UNQ_OPTION_TYPE_STORE` (`option_type_id`,`store_id`),
KEY `CATALOG_PRODUCT_OPTION_TYPE_PRICE_OPTION_TYPE` (`option_type_id`),
KEY `CATALOG_PRODUCT_OPTION_TYPE_PRICE_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_PRICE_OPTION` FOREIGN KEY (`option_type_id`) REFERENCES `catalog_product_option_type_value` (`option_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_PRICE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_option_type_title`
--

DROP TABLE IF EXISTS `catalog_product_option_type_title`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_option_type_title` (
`option_type_title_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`option_type_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`option_type_title_id`),
UNIQUE KEY `UNQ_OPTION_TYPE_STORE` (`option_type_id`,`store_id`),
KEY `CATALOG_PRODUCT_OPTION_TYPE_TITLE_OPTION` (`option_type_id`),
KEY `CATALOG_PRODUCT_OPTION_TYPE_TITLE_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_TITLE_OPTION` FOREIGN KEY (`option_type_id`) REFERENCES `catalog_product_option_type_value` (`option_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_TITLE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_option_type_value`
--

DROP TABLE IF EXISTS `catalog_product_option_type_value`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_option_type_value` (
`option_type_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`option_id` int(10) unsigned NOT NULL DEFAULT '0',
`sku` varchar(64) NOT NULL DEFAULT '',
`sort_order` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`option_type_id`),
KEY `CATALOG_PRODUCT_OPTION_TYPE_VALUE_OPTION` (`option_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_OPTION_TYPE_VALUE_OPTION` FOREIGN KEY (`option_id`) REFERENCES `catalog_product_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_relation`
--

DROP TABLE IF EXISTS `catalog_product_relation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_relation` (
`parent_id` int(10) unsigned NOT NULL,
`child_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`parent_id`,`child_id`),
KEY `IDX_CHILD` (`child_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_RELATION_CHILD` FOREIGN KEY (`child_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_RELATION_PARENT` FOREIGN KEY (`parent_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_super_attribute`
--

DROP TABLE IF EXISTS `catalog_product_super_attribute`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_super_attribute` (
`product_super_attribute_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`position` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`product_super_attribute_id`),
KEY `FK_SUPER_PRODUCT_ATTRIBUTE_PRODUCT` (`product_id`),
CONSTRAINT `FK_SUPER_PRODUCT_ATTRIBUTE_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_super_attribute_label`
--

DROP TABLE IF EXISTS `catalog_product_super_attribute_label`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_super_attribute_label` (
`value_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`product_super_attribute_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`use_default` tinyint(1) unsigned DEFAULT '0',
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`value_id`),
UNIQUE KEY `UNQ_ATTRIBUTE_STORE` (`product_super_attribute_id`,`store_id`),
KEY `FK_SUPER_PRODUCT_ATTRIBUTE_LABEL` (`product_super_attribute_id`),
KEY `FK_CATALOG_PRODUCT_SUPER_ATTRIBUTE_LABEL_STORE` (`store_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_SUPER_ATTRIBUTE_LABEL_ATTRIBUTE` FOREIGN KEY (`product_super_attribute_id`) REFERENCES `catalog_product_super_attribute` (`product_super_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_SUPER_ATTRIBUTE_LABEL_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_super_attribute_pricing`
--

DROP TABLE IF EXISTS `catalog_product_super_attribute_pricing`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_super_attribute_pricing` (
`value_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`product_super_attribute_id` int(10) unsigned NOT NULL DEFAULT '0',
`value_index` varchar(255) NOT NULL DEFAULT '',
`is_percent` tinyint(1) unsigned DEFAULT '0',
`pricing_value` decimal(10,4) DEFAULT NULL,
`website_id` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`value_id`),
KEY `FK_SUPER_PRODUCT_ATTRIBUTE_PRICING` (`product_super_attribute_id`),
KEY `FK_CATALOG_PRODUCT_SUPER_PRICE_WEBSITE` (`website_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_SUPER_PRICE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SUPER_PRODUCT_ATTRIBUTE_PRICING` FOREIGN KEY (`product_super_attribute_id`) REFERENCES `catalog_product_super_attribute` (`product_super_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_super_link`
--

DROP TABLE IF EXISTS `catalog_product_super_link`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_super_link` (
`link_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`parent_id` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`link_id`),
KEY `FK_SUPER_PRODUCT_LINK_PARENT` (`parent_id`),
KEY `FK_catalog_product_super_link` (`product_id`),
CONSTRAINT `FK_SUPER_PRODUCT_LINK_ENTITY` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SUPER_PRODUCT_LINK_PARENT` FOREIGN KEY (`parent_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalog_product_website`
--

DROP TABLE IF EXISTS `catalog_product_website`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalog_product_website` (
`product_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`website_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`product_id`,`website_id`),
KEY `FK_CATALOG_PRODUCT_WEBSITE_WEBSITE` (`website_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_WEBSITE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_WEBSITE_PRODUCT_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogindex_aggregation`
--

DROP TABLE IF EXISTS `catalogindex_aggregation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogindex_aggregation` (
`aggregation_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`store_id` smallint(5) unsigned NOT NULL,
`created_at` datetime NOT NULL,
`key` varchar(255) DEFAULT NULL,
`data` mediumtext,
PRIMARY KEY (`aggregation_id`),
UNIQUE KEY `IDX_STORE_KEY` (`store_id`,`key`),
CONSTRAINT `FK_CATALOGINDEX_AGGREGATION_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogindex_aggregation_tag`
--

DROP TABLE IF EXISTS `catalogindex_aggregation_tag`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogindex_aggregation_tag` (
`tag_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`tag_code` varchar(255) NOT NULL,
PRIMARY KEY (`tag_id`),
UNIQUE KEY `IDX_CODE` (`tag_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogindex_aggregation_to_tag`
--

DROP TABLE IF EXISTS `catalogindex_aggregation_to_tag`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogindex_aggregation_to_tag` (
`aggregation_id` int(10) unsigned NOT NULL,
`tag_id` int(10) unsigned NOT NULL,
UNIQUE KEY `IDX_AGGREGATION_TAG` (`aggregation_id`,`tag_id`),
KEY `FK_CATALOGINDEX_AGGREGATION_TO_TAG_TAG` (`tag_id`),
CONSTRAINT `FK_CATALOGINDEX_AGGREGATION_TO_TAG_AGGREGATION` FOREIGN KEY (`aggregation_id`) REFERENCES `catalogindex_aggregation` (`aggregation_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOGINDEX_AGGREGATION_TO_TAG_TAG` FOREIGN KEY (`tag_id`) REFERENCES `catalogindex_aggregation_tag` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogindex_eav`
--

DROP TABLE IF EXISTS `catalogindex_eav`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogindex_eav` (
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`value` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`store_id`,`entity_id`,`attribute_id`,`value`),
KEY `IDX_VALUE` (`value`),
KEY `FK_CATALOGINDEX_EAV_ENTITY` (`entity_id`),
KEY `FK_CATALOGINDEX_EAV_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOGINDEX_EAV_STORE` (`store_id`),
CONSTRAINT `FK_CATALOGINDEX_EAV_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOGINDEX_EAV_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOGINDEX_EAV_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogindex_minimal_price`
--

DROP TABLE IF EXISTS `catalogindex_minimal_price`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogindex_minimal_price` (
`index_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`customer_group_id` smallint(3) unsigned NOT NULL DEFAULT '0',
`qty` decimal(12,4) unsigned NOT NULL DEFAULT '0.0000',
`value` decimal(12,4) NOT NULL DEFAULT '0.0000',
`tax_class_id` smallint(6) NOT NULL DEFAULT '0',
`website_id` smallint(5) unsigned DEFAULT NULL,
PRIMARY KEY (`index_id`),
KEY `IDX_VALUE` (`value`),
KEY `IDX_QTY` (`qty`),
KEY `FK_CATALOGINDEX_MINIMAL_PRICE_CUSTOMER_GROUP` (`customer_group_id`),
KEY `FK_CI_MINIMAL_PRICE_WEBSITE_ID` (`website_id`),
KEY `IDX_FULL` (`entity_id`,`qty`,`customer_group_id`,`value`,`website_id`),
CONSTRAINT `FK_CI_MINIMAL_PRICE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOGINDEX_MINIMAL_PRICE_CUSTOMER_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOGINDEX_MINIMAL_PRICE_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogindex_price`
--

DROP TABLE IF EXISTS `catalogindex_price`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogindex_price` (
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`customer_group_id` smallint(3) unsigned NOT NULL DEFAULT '0',
`qty` decimal(12,4) unsigned NOT NULL DEFAULT '0.0000',
`value` decimal(12,4) NOT NULL DEFAULT '0.0000',
`tax_class_id` smallint(6) NOT NULL DEFAULT '0',
`website_id` smallint(5) unsigned DEFAULT NULL,
KEY `IDX_VALUE` (`value`),
KEY `IDX_QTY` (`qty`),
KEY `FK_CATALOGINDEX_PRICE_ENTITY` (`entity_id`),
KEY `FK_CATALOGINDEX_PRICE_ATTRIBUTE` (`attribute_id`),
KEY `FK_CATALOGINDEX_PRICE_CUSTOMER_GROUP` (`customer_group_id`),
KEY `IDX_RANGE_VALUE` (`entity_id`,`attribute_id`,`customer_group_id`,`value`),
KEY `FK_CI_PRICE_WEBSITE_ID` (`website_id`),
KEY `IDX_FULL` (`entity_id`,`attribute_id`,`customer_group_id`,`value`,`website_id`),
CONSTRAINT `FK_CI_PRICE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOGINDEX_PRICE_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOGINDEX_PRICE_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `cataloginventory_stock`
--

DROP TABLE IF EXISTS `cataloginventory_stock`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cataloginventory_stock` (
`stock_id` smallint(4) unsigned NOT NULL AUTO_INCREMENT,
`stock_name` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`stock_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Catalog inventory Stocks list';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `cataloginventory_stock_item`
--

DROP TABLE IF EXISTS `cataloginventory_stock_item`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cataloginventory_stock_item` (
`item_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`stock_id` smallint(4) unsigned NOT NULL DEFAULT '0',
`qty` decimal(12,4) NOT NULL DEFAULT '0.0000',
`min_qty` decimal(12,4) NOT NULL DEFAULT '0.0000',
`use_config_min_qty` tinyint(1) unsigned NOT NULL DEFAULT '1',
`is_qty_decimal` tinyint(1) unsigned NOT NULL DEFAULT '0',
`backorders` tinyint(3) unsigned NOT NULL DEFAULT '0',
`use_config_backorders` tinyint(1) unsigned NOT NULL DEFAULT '1',
`min_sale_qty` decimal(12,4) NOT NULL DEFAULT '1.0000',
`use_config_min_sale_qty` tinyint(1) unsigned NOT NULL DEFAULT '1',
`max_sale_qty` decimal(12,4) NOT NULL DEFAULT '0.0000',
`use_config_max_sale_qty` tinyint(1) unsigned NOT NULL DEFAULT '1',
`is_in_stock` tinyint(1) unsigned NOT NULL DEFAULT '0',
`low_stock_date` datetime DEFAULT NULL,
`notify_stock_qty` decimal(12,4) DEFAULT NULL,
`use_config_notify_stock_qty` tinyint(1) unsigned NOT NULL DEFAULT '1',
`manage_stock` tinyint(1) unsigned NOT NULL DEFAULT '0',
`use_config_manage_stock` tinyint(1) unsigned NOT NULL DEFAULT '1',
`stock_status_changed_automatically` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`item_id`),
UNIQUE KEY `IDX_STOCK_PRODUCT` (`product_id`,`stock_id`),
KEY `FK_CATALOGINVENTORY_STOCK_ITEM_PRODUCT` (`product_id`),
KEY `FK_CATALOGINVENTORY_STOCK_ITEM_STOCK` (`stock_id`),
CONSTRAINT `FK_CATALOGINVENTORY_STOCK_ITEM_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOGINVENTORY_STOCK_ITEM_STOCK` FOREIGN KEY (`stock_id`) REFERENCES `cataloginventory_stock` (`stock_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Inventory Stock Item Data';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `cataloginventory_stock_status`
--

DROP TABLE IF EXISTS `cataloginventory_stock_status`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cataloginventory_stock_status` (
`product_id` int(10) unsigned NOT NULL,
`website_id` smallint(5) unsigned NOT NULL,
`stock_id` smallint(4) unsigned NOT NULL,
`qty` decimal(12,4) NOT NULL DEFAULT '0.0000',
`stock_status` tinyint(3) unsigned NOT NULL,
PRIMARY KEY (`product_id`,`website_id`,`stock_id`),
KEY `FK_CATALOGINVENTORY_STOCK_STATUS_STOCK` (`stock_id`),
KEY `FK_CATALOGINVENTORY_STOCK_STATUS_WEBSITE` (`website_id`),
CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_STOCK` FOREIGN KEY (`stock_id`) REFERENCES `cataloginventory_stock` (`stock_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOGINVENTORY_STOCK_STATUS_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogrule`
--

DROP TABLE IF EXISTS `catalogrule`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogrule` (
`rule_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`description` text NOT NULL,
`from_date` date DEFAULT NULL,
`to_date` date DEFAULT NULL,
`customer_group_ids` varchar(255) NOT NULL DEFAULT '',
`is_active` tinyint(1) NOT NULL DEFAULT '0',
`conditions_serialized` mediumtext NOT NULL,
`actions_serialized` mediumtext NOT NULL,
`stop_rules_processing` tinyint(1) NOT NULL DEFAULT '1',
`sort_order` int(10) unsigned NOT NULL DEFAULT '0',
`simple_action` varchar(32) NOT NULL,
`discount_amount` decimal(12,4) NOT NULL,
`website_ids` text,
PRIMARY KEY (`rule_id`),
KEY `sort_order` (`is_active`,`sort_order`,`to_date`,`from_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogrule_affected_product`
--

DROP TABLE IF EXISTS `catalogrule_affected_product`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogrule_affected_product` (
`product_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogrule_group_website`
--

DROP TABLE IF EXISTS `catalogrule_group_website`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogrule_group_website` (
`rule_id` int(10) unsigned NOT NULL DEFAULT '0',
`customer_group_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`website_id` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`rule_id`,`customer_group_id`,`website_id`),
KEY `rule_id` (`rule_id`),
KEY `customer_group_id` (`customer_group_id`),
KEY `website_id` (`website_id`),
CONSTRAINT `FK_CATALOGRULE_GROUP_WEBSITE_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOGRULE_GROUP_WEBSITE_RULE` FOREIGN KEY (`rule_id`) REFERENCES `catalogrule` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOGRULE_GROUP_WEBSITE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogrule_product`
--

DROP TABLE IF EXISTS `catalogrule_product`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogrule_product` (
`rule_product_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`rule_id` int(10) unsigned NOT NULL DEFAULT '0',
`from_time` int(10) unsigned NOT NULL DEFAULT '0',
`to_time` int(10) unsigned NOT NULL DEFAULT '0',
`customer_group_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`action_operator` enum('to_fixed','to_percent','by_fixed','by_percent') NOT NULL DEFAULT 'to_fixed',
`action_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`action_stop` tinyint(1) NOT NULL DEFAULT '0',
`sort_order` int(10) unsigned NOT NULL DEFAULT '0',
`website_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`rule_product_id`),
UNIQUE KEY `sort_order` (`rule_id`,`from_time`,`to_time`,`website_id`,`customer_group_id`,`product_id`,`sort_order`),
KEY `FK_catalogrule_product_rule` (`rule_id`),
KEY `FK_catalogrule_product_customergroup` (`customer_group_id`),
KEY `FK_catalogrule_product_website` (`website_id`),
KEY `FK_CATALOGRULE_PRODUCT_PRODUCT` (`product_id`),
CONSTRAINT `FK_CATALOGRULE_PRODUCT_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_catalogrule_product_customergroup` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_catalogrule_product_rule` FOREIGN KEY (`rule_id`) REFERENCES `catalogrule` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_catalogrule_product_website` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogrule_product_price`
--

DROP TABLE IF EXISTS `catalogrule_product_price`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogrule_product_price` (
`rule_product_price_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`rule_date` date NOT NULL DEFAULT '0000-00-00',
`customer_group_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`rule_price` decimal(12,4) NOT NULL DEFAULT '0.0000',
`website_id` smallint(5) unsigned NOT NULL,
`latest_start_date` date DEFAULT NULL,
`earliest_end_date` date DEFAULT NULL,
PRIMARY KEY (`rule_product_price_id`),
UNIQUE KEY `rule_date` (`rule_date`,`website_id`,`customer_group_id`,`product_id`),
KEY `FK_catalogrule_product_price_customergroup` (`customer_group_id`),
KEY `FK_catalogrule_product_price_website` (`website_id`),
KEY `FK_CATALOGRULE_PRODUCT_PRICE_PRODUCT` (`product_id`),
CONSTRAINT `FK_CATALOGRULE_PRODUCT_PRICE_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_catalogrule_product_price_customergroup` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_catalogrule_product_price_website` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogsearch_fulltext`
--

DROP TABLE IF EXISTS `catalogsearch_fulltext`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogsearch_fulltext` (
`product_id` int(10) unsigned NOT NULL,
`store_id` smallint(5) unsigned NOT NULL,
`data_index` longtext NOT NULL,
PRIMARY KEY (`product_id`,`store_id`),
FULLTEXT KEY `data_index` (`data_index`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogsearch_query`
--

DROP TABLE IF EXISTS `catalogsearch_query`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogsearch_query` (
`query_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`query_text` varchar(255) NOT NULL DEFAULT '',
`num_results` int(10) unsigned NOT NULL DEFAULT '0',
`popularity` int(10) unsigned NOT NULL DEFAULT '0',
`redirect` varchar(255) NOT NULL DEFAULT '',
`synonym_for` varchar(255) NOT NULL,
`store_id` smallint(5) unsigned NOT NULL,
`display_in_terms` tinyint(1) NOT NULL DEFAULT '1',
`is_active` tinyint(1) DEFAULT '1',
`is_processed` tinyint(1) DEFAULT '0',
`updated_at` datetime NOT NULL,
PRIMARY KEY (`query_id`),
KEY `FK_CATALOGSEARCH_QUERY_STORE` (`store_id`),
KEY `IDX_SEARCH_QUERY` (`query_text`,`store_id`,`popularity`),
CONSTRAINT `FK_CATALOGSEARCH_QUERY_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `catalogsearch_result`
--

DROP TABLE IF EXISTS `catalogsearch_result`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `catalogsearch_result` (
`query_id` int(10) unsigned NOT NULL,
`product_id` int(10) unsigned NOT NULL,
`relevance` decimal(6,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`query_id`,`product_id`),
KEY `IDX_QUERY` (`query_id`),
KEY `IDX_PRODUCT` (`product_id`),
KEY `IDX_RELEVANCE` (`query_id`,`relevance`),
CONSTRAINT `FK_CATALOGSEARCH_RESULT_QUERY` FOREIGN KEY (`query_id`) REFERENCES `catalogsearch_query` (`query_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOGSEARCH_RESULT_CATALOG_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `checkout_agreement`
--

DROP TABLE IF EXISTS `checkout_agreement`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `checkout_agreement` (
`agreement_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`content` text NOT NULL,
`content_height` varchar(25) DEFAULT NULL,
`checkbox_text` text NOT NULL,
`is_active` tinyint(4) NOT NULL DEFAULT '0',
`is_html` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`agreement_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `checkout_agreement_store`
--

DROP TABLE IF EXISTS `checkout_agreement_store`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `checkout_agreement_store` (
`agreement_id` int(10) unsigned NOT NULL,
`store_id` smallint(5) unsigned NOT NULL,
UNIQUE KEY `agreement_id` (`agreement_id`,`store_id`),
KEY `FK_CHECKOUT_AGREEMENT_STORE` (`store_id`),
CONSTRAINT `FK_CHECKOUT_AGREEMENT` FOREIGN KEY (`agreement_id`) REFERENCES `checkout_agreement` (`agreement_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CHECKOUT_AGREEMENT_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `cms_block`
--

DROP TABLE IF EXISTS `cms_block`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cms_block` (
`block_id` smallint(6) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`identifier` varchar(255) NOT NULL DEFAULT '',
`content` mediumtext,
`creation_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`is_active` tinyint(1) NOT NULL DEFAULT '1',
PRIMARY KEY (`block_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='CMS Blocks';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `cms_block_store`
--

DROP TABLE IF EXISTS `cms_block_store`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cms_block_store` (
`block_id` smallint(6) NOT NULL,
`store_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`block_id`,`store_id`),
KEY `FK_CMS_BLOCK_STORE_STORE` (`store_id`),
CONSTRAINT `FK_CMS_BLOCK_STORE_BLOCK` FOREIGN KEY (`block_id`) REFERENCES `cms_block` (`block_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CMS_BLOCK_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='CMS Blocks to Stores';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `cms_page`
--

DROP TABLE IF EXISTS `cms_page`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cms_page` (
`page_id` smallint(6) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`root_template` varchar(255) NOT NULL DEFAULT '',
`meta_keywords` text NOT NULL,
`meta_description` text NOT NULL,
`identifier` varchar(100) NOT NULL DEFAULT '',
`content_heading` varchar(255) NOT NULL DEFAULT '',
`content` mediumtext,
`creation_time` datetime DEFAULT NULL,
`update_time` datetime DEFAULT NULL,
`is_active` tinyint(1) NOT NULL DEFAULT '1',
`sort_order` tinyint(4) NOT NULL DEFAULT '0',
`layout_update_xml` text,
`custom_theme` varchar(100) DEFAULT NULL,
`custom_root_template` varchar(255) NOT NULL DEFAULT '',
`custom_layout_update_xml` text,
`custom_theme_from` date DEFAULT NULL,
`custom_theme_to` date DEFAULT NULL,
PRIMARY KEY (`page_id`),
KEY `identifier` (`identifier`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='CMS pages';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `cms_page_store`
--

DROP TABLE IF EXISTS `cms_page_store`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cms_page_store` (
`page_id` smallint(6) NOT NULL,
`store_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`page_id`,`store_id`),
KEY `FK_CMS_PAGE_STORE_STORE` (`store_id`),
CONSTRAINT `FK_CMS_PAGE_STORE_PAGE` FOREIGN KEY (`page_id`) REFERENCES `cms_page` (`page_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CMS_PAGE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='CMS Pages to Stores';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_cache`
--

DROP TABLE IF EXISTS `core_cache`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_cache` (
`id` varchar(255) NOT NULL,
`data` mediumblob,
`create_time` int(11) DEFAULT NULL,
`update_time` int(11) DEFAULT NULL,
`expire_time` int(11) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `IDX_EXPIRE_TIME` (`expire_time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_cache_option`
--

DROP TABLE IF EXISTS `core_cache_option`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_cache_option` (
`code` varchar(32) NOT NULL,
`value` tinyint(3) DEFAULT NULL,
PRIMARY KEY (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_cache_tag`
--

DROP TABLE IF EXISTS `core_cache_tag`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_cache_tag` (
`tag` varchar(255) NOT NULL,
`cache_id` varchar(255) NOT NULL,
KEY `IDX_TAG` (`tag`),
KEY `IDX_CACHE_ID` (`cache_id`),
CONSTRAINT `FK_CORE_CACHE_TAG` FOREIGN KEY (`cache_id`) REFERENCES `core_cache` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_config_data`
--

DROP TABLE IF EXISTS `core_config_data`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_config_data` (
`config_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`scope` enum('default','websites','stores','config') NOT NULL DEFAULT 'default',
`scope_id` int(11) NOT NULL DEFAULT '0',
`path` varchar(255) NOT NULL DEFAULT 'general',
`value` text NOT NULL,
PRIMARY KEY (`config_id`),
UNIQUE KEY `config_scope` (`scope`,`scope_id`,`path`)
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_email_template`
--

DROP TABLE IF EXISTS `core_email_template`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_email_template` (
`template_id` int(7) unsigned NOT NULL AUTO_INCREMENT,
`template_code` varchar(150) DEFAULT NULL,
`template_text` text,
`template_styles` text,
`template_type` int(3) unsigned DEFAULT NULL,
`template_subject` varchar(200) DEFAULT NULL,
`template_sender_name` varchar(200) DEFAULT NULL,
`template_sender_email` varchar(200) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
`added_at` datetime DEFAULT NULL,
`modified_at` datetime DEFAULT NULL,
`orig_template_code` varchar(200) DEFAULT NULL,
`orig_template_variables` text NOT NULL,
PRIMARY KEY (`template_id`),
UNIQUE KEY `template_code` (`template_code`),
KEY `added_at` (`added_at`),
KEY `modified_at` (`modified_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Email templates';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_flag`
--

DROP TABLE IF EXISTS `core_flag`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_flag` (
`flag_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`flag_code` varchar(255) NOT NULL,
`state` smallint(5) unsigned NOT NULL DEFAULT '0',
`flag_data` text,
`last_update` datetime NOT NULL,
PRIMARY KEY (`flag_id`),
KEY `last_update` (`last_update`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_layout_link`
--

DROP TABLE IF EXISTS `core_layout_link`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_layout_link` (
`layout_link_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`area` varchar(64) NOT NULL DEFAULT '',
`package` varchar(64) NOT NULL DEFAULT '',
`theme` varchar(64) NOT NULL DEFAULT '',
`layout_update_id` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`layout_link_id`),
UNIQUE KEY `store_id` (`store_id`,`package`,`theme`,`layout_update_id`),
KEY `FK_core_layout_link_update` (`layout_update_id`),
CONSTRAINT `FK_CORE_LAYOUT_LINK_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CORE_LAYOUT_LINK_UPDATE` FOREIGN KEY (`layout_update_id`) REFERENCES `core_layout_update` (`layout_update_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_layout_update`
--

DROP TABLE IF EXISTS `core_layout_update`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_layout_update` (
`layout_update_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`handle` varchar(255) DEFAULT NULL,
`xml` text,
`sort_order` smallint(5) NOT NULL DEFAULT '0',
PRIMARY KEY (`layout_update_id`),
KEY `handle` (`handle`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_resource`
--

DROP TABLE IF EXISTS `core_resource`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_resource` (
`code` varchar(50) NOT NULL DEFAULT '',
`version` varchar(50) NOT NULL DEFAULT '',
`data_version` varchar(50) DEFAULT NULL,
PRIMARY KEY (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Resource version registry';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_session`
--

DROP TABLE IF EXISTS `core_session`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_session` (
`session_id` varchar(255) NOT NULL DEFAULT '',
`website_id` smallint(5) unsigned DEFAULT NULL,
`session_expires` int(10) unsigned NOT NULL DEFAULT '0',
`session_data` mediumblob NOT NULL,
PRIMARY KEY (`session_id`),
KEY `FK_SESSION_WEBSITE` (`website_id`),
CONSTRAINT `FK_SESSION_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Session data store';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_store`
--

DROP TABLE IF EXISTS `core_store`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_store` (
`store_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`code` varchar(32) NOT NULL DEFAULT '',
`website_id` smallint(5) unsigned DEFAULT '0',
`group_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`name` varchar(255) NOT NULL,
`sort_order` smallint(5) unsigned NOT NULL DEFAULT '0',
`is_active` tinyint(1) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`store_id`),
UNIQUE KEY `code` (`code`),
KEY `FK_STORE_WEBSITE` (`website_id`),
KEY `is_active` (`is_active`,`sort_order`),
KEY `FK_STORE_GROUP` (`group_id`),
CONSTRAINT `FK_STORE_GROUP_STORE` FOREIGN KEY (`group_id`) REFERENCES `core_store_group` (`group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_STORE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Stores';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_store_group`
--

DROP TABLE IF EXISTS `core_store_group`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_store_group` (
`group_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`website_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`name` varchar(255) NOT NULL,
`root_category_id` int(10) unsigned NOT NULL DEFAULT '0',
`default_store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`group_id`),
KEY `FK_STORE_GROUP_WEBSITE` (`website_id`),
KEY `default_store_id` (`default_store_id`),
CONSTRAINT `FK_STORE_GROUP_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_translate`
--

DROP TABLE IF EXISTS `core_translate`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_translate` (
`key_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`string` varchar(255) NOT NULL DEFAULT '',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`translate` varchar(255) NOT NULL DEFAULT '',
`locale` varchar(20) NOT NULL DEFAULT 'en_US',
PRIMARY KEY (`key_id`),
UNIQUE KEY `IDX_CODE` (`store_id`,`locale`,`string`),
KEY `FK_CORE_TRANSLATE_STORE` (`store_id`),
CONSTRAINT `FK_CORE_TRANSLATE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Translation data';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_url_rewrite`
--

DROP TABLE IF EXISTS `core_url_rewrite`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_url_rewrite` (
`url_rewrite_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`category_id` int(10) unsigned DEFAULT NULL,
`product_id` int(10) unsigned DEFAULT NULL,
`id_path` varchar(255) NOT NULL DEFAULT '',
`request_path` varchar(255) NOT NULL DEFAULT '',
`target_path` varchar(255) NOT NULL DEFAULT '',
`is_system` tinyint(1) unsigned DEFAULT '1',
`options` varchar(255) NOT NULL DEFAULT '',
`description` varchar(255) DEFAULT NULL,
PRIMARY KEY (`url_rewrite_id`),
UNIQUE KEY `UNQ_REQUEST_PATH` (`request_path`,`store_id`),
UNIQUE KEY `UNQ_PATH` (`id_path`,`is_system`,`store_id`),
KEY `FK_CORE_URL_REWRITE_STORE` (`store_id`),
KEY `IDX_ID_PATH` (`id_path`),
KEY `IDX_TARGET_PATH` (`target_path`,`store_id`),
KEY `FK_CORE_URL_REWRITE_PRODUCT` (`product_id`),
KEY `IDX_CATEGORY_REWRITE` (`category_id`,`is_system`,`product_id`,`store_id`,`id_path`),
CONSTRAINT `FK_CORE_URL_REWRITE_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CORE_URL_REWRITE_CATEGORY` FOREIGN KEY (`category_id`) REFERENCES `catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CORE_URL_REWRITE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_variable`
--

DROP TABLE IF EXISTS `core_variable`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_variable` (
`variable_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`code` varchar(255) NOT NULL DEFAULT '',
`name` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`variable_id`),
UNIQUE KEY `IDX_CODE` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_variable_value`
--

DROP TABLE IF EXISTS `core_variable_value`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_variable_value` (
`value_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`variable_id` int(11) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`plain_value` text NOT NULL,
`html_value` text NOT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_VARIABLE_STORE` (`variable_id`,`store_id`),
KEY `IDX_VARIABLE_ID` (`variable_id`),
KEY `IDX_STORE_ID` (`store_id`),
CONSTRAINT `FK_CORE_VARIABLE_VALUE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CORE_VARIABLE_VALUE_VARIABLE_ID` FOREIGN KEY (`variable_id`) REFERENCES `core_variable` (`variable_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `core_website`
--

DROP TABLE IF EXISTS `core_website`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `core_website` (
`website_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`code` varchar(32) NOT NULL DEFAULT '',
`name` varchar(64) NOT NULL DEFAULT '',
`sort_order` smallint(5) unsigned NOT NULL DEFAULT '0',
`default_group_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`is_default` tinyint(1) unsigned DEFAULT '0',
PRIMARY KEY (`website_id`),
UNIQUE KEY `code` (`code`),
KEY `sort_order` (`sort_order`),
KEY `default_group_id` (`default_group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Websites';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `coupon_aggregated`
--

DROP TABLE IF EXISTS `coupon_aggregated`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `coupon_aggregated` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`period` date NOT NULL DEFAULT '0000-00-00',
`store_id` smallint(5) unsigned DEFAULT NULL,
`order_status` varchar(50) NOT NULL DEFAULT '',
`coupon_code` varchar(50) NOT NULL DEFAULT '',
`coupon_uses` int(11) NOT NULL DEFAULT '0',
`subtotal_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`total_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`id`),
UNIQUE KEY `UNQ_COUPON_AGGREGATED_PSOC` (`period`,`store_id`,`order_status`,`coupon_code`),
KEY `IDX_STORE_ID` (`store_id`),
CONSTRAINT `FK_SALESTRULE_COUPON_AGGREGATED_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `coupon_aggregated_order`
--

DROP TABLE IF EXISTS `coupon_aggregated_order`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `coupon_aggregated_order` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`period` date NOT NULL DEFAULT '0000-00-00',
`store_id` smallint(5) unsigned DEFAULT NULL,
`order_status` varchar(50) NOT NULL DEFAULT '',
`coupon_code` varchar(50) NOT NULL DEFAULT '',
`coupon_uses` int(11) NOT NULL DEFAULT '0',
`subtotal_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`total_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`id`),
UNIQUE KEY `UNQ_COUPON_AGGREGATED_ORDER_PSOC` (`period`,`store_id`,`order_status`,`coupon_code`),
KEY `IDX_STORE_ID` (`store_id`),
CONSTRAINT `FK_SALESTRULE_COUPON_AGGREGATED_ORDER_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `cron_schedule`
--

DROP TABLE IF EXISTS `cron_schedule`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cron_schedule` (
`schedule_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`job_code` varchar(255) NOT NULL DEFAULT '0',
`status` enum('pending','running','success','missed','error') NOT NULL DEFAULT 'pending',
`messages` text,
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`scheduled_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`executed_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`finished_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`schedule_id`),
KEY `task_name` (`job_code`),
KEY `scheduled_at` (`scheduled_at`,`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_address_entity`
--

DROP TABLE IF EXISTS `customer_address_entity`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_address_entity` (
`entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_set_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`increment_id` varchar(50) NOT NULL DEFAULT '',
`parent_id` int(10) unsigned DEFAULT NULL,
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`is_active` tinyint(1) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`entity_id`),
KEY `FK_CUSTOMER_ADDRESS_CUSTOMER_ID` (`parent_id`),
CONSTRAINT `FK_CUSTOMER_ADDRESS_CUSTOMER_ID` FOREIGN KEY (`parent_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Customer Address Entities';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_address_entity_datetime`
--

DROP TABLE IF EXISTS `customer_address_entity_datetime`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_address_entity_datetime` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`),
KEY `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_CUSTOMER_ADDRESS_DATETIME_ATTRIBUTE` (`attribute_id`),
KEY `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY` (`entity_id`),
KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`),
CONSTRAINT `FK_CUSTOMER_ADDRESS_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `customer_address_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_ADDRESS_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_address_entity_decimal`
--

DROP TABLE IF EXISTS `customer_address_entity_decimal`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_address_entity_decimal` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`),
KEY `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_CUSTOMER_ADDRESS_DECIMAL_ATTRIBUTE` (`attribute_id`),
KEY `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY` (`entity_id`),
KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`),
CONSTRAINT `FK_CUSTOMER_ADDRESS_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `customer_address_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_ADDRESS_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_address_entity_int`
--

DROP TABLE IF EXISTS `customer_address_entity_int`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_address_entity_int` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`),
KEY `FK_CUSTOMER_ADDRESS_INT_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_CUSTOMER_ADDRESS_INT_ATTRIBUTE` (`attribute_id`),
KEY `FK_CUSTOMER_ADDRESS_INT_ENTITY` (`entity_id`),
KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`),
CONSTRAINT `FK_CUSTOMER_ADDRESS_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_ADDRESS_INT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `customer_address_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_ADDRESS_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_address_entity_text`
--

DROP TABLE IF EXISTS `customer_address_entity_text`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_address_entity_text` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` text NOT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`),
KEY `FK_CUSTOMER_ADDRESS_TEXT_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_CUSTOMER_ADDRESS_TEXT_ATTRIBUTE` (`attribute_id`),
KEY `FK_CUSTOMER_ADDRESS_TEXT_ENTITY` (`entity_id`),
CONSTRAINT `FK_CUSTOMER_ADDRESS_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_ADDRESS_TEXT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `customer_address_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_ADDRESS_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_address_entity_varchar`
--

DROP TABLE IF EXISTS `customer_address_entity_varchar`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_address_entity_varchar` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`),
KEY `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_CUSTOMER_ADDRESS_VARCHAR_ATTRIBUTE` (`attribute_id`),
KEY `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY` (`entity_id`),
KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`),
CONSTRAINT `FK_CUSTOMER_ADDRESS_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `customer_address_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_ADDRESS_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_eav_attribute`
--

DROP TABLE IF EXISTS `customer_eav_attribute`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_eav_attribute` (
`attribute_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`is_visible` tinyint(1) unsigned NOT NULL DEFAULT '1',
`is_visible_on_front` tinyint(1) unsigned NOT NULL DEFAULT '0',
`input_filter` varchar(255) NOT NULL,
`lines_to_divide_multiline` smallint(5) unsigned NOT NULL DEFAULT '0',
`min_text_length` int(11) unsigned NOT NULL DEFAULT '0',
`max_text_length` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`attribute_id`),
CONSTRAINT `FK_CUSTOMER_EAV_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_entity`
--

DROP TABLE IF EXISTS `customer_entity`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_entity` (
`entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_set_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`website_id` smallint(5) unsigned DEFAULT NULL,
`email` varchar(255) NOT NULL DEFAULT '',
`group_id` smallint(3) unsigned NOT NULL DEFAULT '0',
`increment_id` varchar(50) NOT NULL DEFAULT '',
`store_id` smallint(5) unsigned DEFAULT '0',
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`is_active` tinyint(1) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`entity_id`),
KEY `FK_CUSTOMER_ENTITY_STORE` (`store_id`),
KEY `IDX_ENTITY_TYPE` (`entity_type_id`),
KEY `IDX_AUTH` (`email`,`website_id`),
KEY `FK_CUSTOMER_WEBSITE` (`website_id`),
CONSTRAINT `FK_CUSTOMER_ENTITY_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Customer Entityies';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_entity_datetime`
--

DROP TABLE IF EXISTS `customer_entity_datetime`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_entity_datetime` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`),
KEY `FK_CUSTOMER_DATETIME_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_CUSTOMER_DATETIME_ATTRIBUTE` (`attribute_id`),
KEY `FK_CUSTOMER_DATETIME_ENTITY` (`entity_id`),
KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`),
CONSTRAINT `FK_CUSTOMER_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_DATETIME_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_entity_decimal`
--

DROP TABLE IF EXISTS `customer_entity_decimal`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_entity_decimal` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`),
KEY `FK_CUSTOMER_DECIMAL_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_CUSTOMER_DECIMAL_ATTRIBUTE` (`attribute_id`),
KEY `FK_CUSTOMER_DECIMAL_ENTITY` (`entity_id`),
KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`),
CONSTRAINT `FK_CUSTOMER_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_entity_int`
--

DROP TABLE IF EXISTS `customer_entity_int`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_entity_int` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`),
KEY `FK_CUSTOMER_INT_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_CUSTOMER_INT_ATTRIBUTE` (`attribute_id`),
KEY `FK_CUSTOMER_INT_ENTITY` (`entity_id`),
KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`),
CONSTRAINT `FK_CUSTOMER_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_INT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_entity_text`
--

DROP TABLE IF EXISTS `customer_entity_text`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_entity_text` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` text NOT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`),
KEY `FK_CUSTOMER_TEXT_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_CUSTOMER_TEXT_ATTRIBUTE` (`attribute_id`),
KEY `FK_CUSTOMER_TEXT_ENTITY` (`entity_id`),
CONSTRAINT `FK_CUSTOMER_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_TEXT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_entity_varchar`
--

DROP TABLE IF EXISTS `customer_entity_varchar`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_entity_varchar` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`value_id`),
UNIQUE KEY `IDX_ATTRIBUTE_VALUE` (`entity_id`,`attribute_id`),
KEY `FK_CUSTOMER_VARCHAR_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_CUSTOMER_VARCHAR_ATTRIBUTE` (`attribute_id`),
KEY `FK_CUSTOMER_VARCHAR_ENTITY` (`entity_id`),
KEY `IDX_VALUE` (`entity_id`,`attribute_id`,`value`),
CONSTRAINT `FK_CUSTOMER_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_VARCHAR_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CUSTOMER_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `customer_group`
--

DROP TABLE IF EXISTS `customer_group`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `customer_group` (
`customer_group_id` smallint(3) unsigned NOT NULL AUTO_INCREMENT,
`customer_group_code` varchar(32) NOT NULL DEFAULT '',
`tax_class_id` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`customer_group_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='Customer groups';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `dataflow_batch`
--

DROP TABLE IF EXISTS `dataflow_batch`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `dataflow_batch` (
`batch_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`adapter` varchar(128) DEFAULT NULL,
`params` text,
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`batch_id`),
KEY `FK_DATAFLOW_BATCH_PROFILE` (`profile_id`),
KEY `FK_DATAFLOW_BATCH_STORE` (`store_id`),
KEY `IDX_CREATED_AT` (`created_at`),
CONSTRAINT `FK_DATAFLOW_BATCH_PROFILE` FOREIGN KEY (`profile_id`) REFERENCES `dataflow_profile` (`profile_id`) ON DELETE CASCADE,
CONSTRAINT `FK_DATAFLOW_BATCH_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `dataflow_batch_export`
--

DROP TABLE IF EXISTS `dataflow_batch_export`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `dataflow_batch_export` (
`batch_export_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`batch_id` int(10) unsigned NOT NULL DEFAULT '0',
`batch_data` longtext,
`status` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`batch_export_id`),
KEY `FK_DATAFLOW_BATCH_EXPORT_BATCH` (`batch_id`),
CONSTRAINT `FK_DATAFLOW_BATCH_EXPORT_BATCH` FOREIGN KEY (`batch_id`) REFERENCES `dataflow_batch` (`batch_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `dataflow_batch_import`
--

DROP TABLE IF EXISTS `dataflow_batch_import`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `dataflow_batch_import` (
`batch_import_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`batch_id` int(10) unsigned NOT NULL DEFAULT '0',
`batch_data` longtext,
`status` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`batch_import_id`),
KEY `FK_DATAFLOW_BATCH_IMPORT_BATCH` (`batch_id`),
CONSTRAINT `FK_DATAFLOW_BATCH_IMPORT_BATCH` FOREIGN KEY (`batch_id`) REFERENCES `dataflow_batch` (`batch_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `dataflow_import_data`
--

DROP TABLE IF EXISTS `dataflow_import_data`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `dataflow_import_data` (
`import_id` int(11) NOT NULL AUTO_INCREMENT,
`session_id` int(11) DEFAULT NULL,
`serial_number` int(11) NOT NULL DEFAULT '0',
`value` text,
`status` int(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`import_id`),
KEY `FK_dataflow_import_data` (`session_id`),
CONSTRAINT `FK_dataflow_import_data` FOREIGN KEY (`session_id`) REFERENCES `dataflow_session` (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `dataflow_profile`
--

DROP TABLE IF EXISTS `dataflow_profile`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `dataflow_profile` (
`profile_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`actions_xml` text,
`gui_data` text,
`direction` enum('import','export') DEFAULT NULL,
`entity_type` varchar(64) NOT NULL DEFAULT '',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`data_transfer` enum('file','interactive') DEFAULT NULL,
PRIMARY KEY (`profile_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `dataflow_profile_history`
--

DROP TABLE IF EXISTS `dataflow_profile_history`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `dataflow_profile_history` (
`history_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`profile_id` int(10) unsigned NOT NULL DEFAULT '0',
`action_code` varchar(64) DEFAULT NULL,
`user_id` int(10) unsigned NOT NULL DEFAULT '0',
`performed_at` datetime DEFAULT NULL,
PRIMARY KEY (`history_id`),
KEY `FK_dataflow_profile_history` (`profile_id`),
CONSTRAINT `FK_dataflow_profile_history` FOREIGN KEY (`profile_id`) REFERENCES `dataflow_profile` (`profile_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `dataflow_session`
--

DROP TABLE IF EXISTS `dataflow_session`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `dataflow_session` (
`session_id` int(11) NOT NULL AUTO_INCREMENT,
`user_id` int(11) NOT NULL,
`created_date` datetime DEFAULT NULL,
`file` varchar(255) DEFAULT NULL,
`type` varchar(32) DEFAULT NULL,
`direction` varchar(32) DEFAULT NULL,
`comment` varchar(255) DEFAULT NULL,
PRIMARY KEY (`session_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `design_change`
--

DROP TABLE IF EXISTS `design_change`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `design_change` (
`design_change_id` int(11) NOT NULL AUTO_INCREMENT,
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`design` varchar(255) NOT NULL DEFAULT '',
`date_from` date DEFAULT NULL,
`date_to` date DEFAULT NULL,
PRIMARY KEY (`design_change_id`),
KEY `FK_DESIGN_CHANGE_STORE` (`store_id`),
CONSTRAINT `FK_DESIGN_CHANGE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `directory_country`
--

DROP TABLE IF EXISTS `directory_country`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `directory_country` (
`country_id` varchar(2) NOT NULL DEFAULT '',
`iso2_code` varchar(2) NOT NULL DEFAULT '',
`iso3_code` varchar(3) NOT NULL DEFAULT '',
PRIMARY KEY (`country_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Countries';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `directory_country_format`
--

DROP TABLE IF EXISTS `directory_country_format`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `directory_country_format` (
`country_format_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`country_id` varchar(2) NOT NULL DEFAULT '',
`type` varchar(30) NOT NULL DEFAULT '',
`format` text NOT NULL,
PRIMARY KEY (`country_format_id`),
UNIQUE KEY `country_type` (`country_id`,`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Countries format';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `directory_country_region`
--

DROP TABLE IF EXISTS `directory_country_region`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `directory_country_region` (
`region_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`country_id` varchar(4) NOT NULL DEFAULT '0',
`code` varchar(32) NOT NULL DEFAULT '',
`default_name` varchar(255) DEFAULT NULL,
PRIMARY KEY (`region_id`),
KEY `FK_REGION_COUNTRY` (`country_id`)
) ENGINE=InnoDB AUTO_INCREMENT=320 DEFAULT CHARSET=utf8 COMMENT='Country regions';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `directory_country_region_name`
--

DROP TABLE IF EXISTS `directory_country_region_name`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `directory_country_region_name` (
`locale` varchar(8) NOT NULL DEFAULT '',
`region_id` mediumint(8) unsigned NOT NULL DEFAULT '0',
`name` varchar(64) NOT NULL DEFAULT '',
PRIMARY KEY (`locale`,`region_id`),
KEY `FK_DIRECTORY_REGION_NAME_REGION` (`region_id`),
CONSTRAINT `FK_DIRECTORY_REGION_NAME_REGION` FOREIGN KEY (`region_id`) REFERENCES `directory_country_region` (`region_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Regions names';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `directory_currency_rate`
--

DROP TABLE IF EXISTS `directory_currency_rate`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `directory_currency_rate` (
`currency_from` char(3) NOT NULL DEFAULT '',
`currency_to` char(3) NOT NULL DEFAULT '',
`rate` decimal(24,12) NOT NULL DEFAULT '0.000000000000',
PRIMARY KEY (`currency_from`,`currency_to`),
KEY `FK_CURRENCY_RATE_TO` (`currency_to`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `downloadable_link`
--

DROP TABLE IF EXISTS `downloadable_link`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `downloadable_link` (
`link_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`sort_order` int(10) unsigned NOT NULL DEFAULT '0',
`number_of_downloads` int(10) unsigned DEFAULT NULL,
`is_shareable` smallint(1) unsigned NOT NULL DEFAULT '0',
`link_url` varchar(255) NOT NULL DEFAULT '',
`link_file` varchar(255) NOT NULL DEFAULT '',
`link_type` varchar(20) NOT NULL DEFAULT '',
`sample_url` varchar(255) NOT NULL DEFAULT '',
`sample_file` varchar(255) NOT NULL DEFAULT '',
`sample_type` varchar(20) NOT NULL DEFAULT '',
PRIMARY KEY (`link_id`),
KEY `DOWNLODABLE_LINK_PRODUCT` (`product_id`),
KEY `DOWNLODABLE_LINK_PRODUCT_SORT_ORDER` (`product_id`,`sort_order`),
CONSTRAINT `FK_DOWNLODABLE_LINK_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `downloadable_link_price`
--

DROP TABLE IF EXISTS `downloadable_link_price`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `downloadable_link_price` (
`price_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`link_id` int(10) unsigned NOT NULL DEFAULT '0',
`website_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`price` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`price_id`),
KEY `DOWNLOADABLE_LINK_PRICE_LINK` (`link_id`),
KEY `DOWNLOADABLE_LINK_PRICE_WEBSITE` (`website_id`),
CONSTRAINT `FK_DOWNLOADABLE_LINK_PRICE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_DOWNLOADABLE_LINK_PRICE_LINK` FOREIGN KEY (`link_id`) REFERENCES `downloadable_link` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `downloadable_link_purchased`
--

DROP TABLE IF EXISTS `downloadable_link_purchased`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `downloadable_link_purchased` (
`purchased_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`order_id` int(10) unsigned NOT NULL DEFAULT '0',
`order_increment_id` varchar(50) NOT NULL DEFAULT '',
`order_item_id` int(10) unsigned NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`customer_id` int(10) unsigned NOT NULL DEFAULT '0',
`product_name` varchar(255) NOT NULL DEFAULT '',
`product_sku` varchar(255) NOT NULL DEFAULT '',
`link_section_title` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`purchased_id`),
KEY `DOWNLOADABLE_ORDER_ID` (`order_id`),
KEY `DOWNLOADABLE_CUSTOMER_ID` (`customer_id`),
KEY `KEY_DOWNLOADABLE_ORDER_ITEM_ID` (`order_item_id`),
CONSTRAINT `FK_DOWNLOADABLE_PURCHASED_ORDER_ITEM_ID` FOREIGN KEY (`order_item_id`) REFERENCES `sales_flat_order_item` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_DOWNLOADABLE_ORDER_ID` FOREIGN KEY (`order_id`) REFERENCES `sales_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `downloadable_link_purchased_item`
--

DROP TABLE IF EXISTS `downloadable_link_purchased_item`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `downloadable_link_purchased_item` (
`item_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`purchased_id` int(10) unsigned NOT NULL DEFAULT '0',
`order_item_id` int(10) unsigned NOT NULL DEFAULT '0',
`product_id` int(10) unsigned DEFAULT '0',
`link_hash` varchar(255) NOT NULL DEFAULT '',
`number_of_downloads_bought` int(10) unsigned NOT NULL DEFAULT '0',
`number_of_downloads_used` int(10) unsigned NOT NULL DEFAULT '0',
`link_id` int(20) unsigned NOT NULL DEFAULT '0',
`link_title` varchar(255) NOT NULL DEFAULT '',
`is_shareable` smallint(1) unsigned NOT NULL DEFAULT '0',
`link_url` varchar(255) NOT NULL DEFAULT '',
`link_file` varchar(255) NOT NULL DEFAULT '',
`link_type` varchar(255) NOT NULL DEFAULT '',
`status` varchar(50) NOT NULL DEFAULT '',
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`item_id`),
KEY `DOWNLOADABLE_LINK_PURCHASED_ID` (`purchased_id`),
KEY `DOWNLOADABLE_ORDER_ITEM_ID` (`order_item_id`),
KEY `DOWNLOADALBE_LINK_HASH` (`link_hash`),
CONSTRAINT `FK_DOWNLOADABLE_LINK_PURCHASED_ID` FOREIGN KEY (`purchased_id`) REFERENCES `downloadable_link_purchased` (`purchased_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_DOWNLOADABLE_ORDER_ITEM_ID` FOREIGN KEY (`order_item_id`) REFERENCES `sales_flat_order_item` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `downloadable_link_title`
--

DROP TABLE IF EXISTS `downloadable_link_title`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `downloadable_link_title` (
`title_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`link_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`title_id`),
UNIQUE KEY `UNQ_LINK_TITLE_STORE` (`link_id`,`store_id`),
KEY `DOWNLOADABLE_LINK_TITLE_LINK` (`link_id`),
KEY `DOWNLOADABLE_LINK_TITLE_STORE` (`store_id`),
CONSTRAINT `FK_DOWNLOADABLE_LINK_TITLE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_DOWNLOADABLE_LINK_TITLE_LINK` FOREIGN KEY (`link_id`) REFERENCES `downloadable_link` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `downloadable_sample`
--

DROP TABLE IF EXISTS `downloadable_sample`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `downloadable_sample` (
`sample_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`sample_url` varchar(255) NOT NULL DEFAULT '',
`sample_file` varchar(255) NOT NULL DEFAULT '',
`sample_type` varchar(20) NOT NULL DEFAULT '',
`sort_order` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`sample_id`),
KEY `DOWNLODABLE_SAMPLE_PRODUCT` (`product_id`),
CONSTRAINT `FK_DOWNLODABLE_SAMPLE_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `downloadable_sample_title`
--

DROP TABLE IF EXISTS `downloadable_sample_title`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `downloadable_sample_title` (
`title_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`sample_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`title_id`),
UNIQUE KEY `UNQ_SAMPLE_TITLE_STORE` (`sample_id`,`store_id`),
KEY `DOWNLOADABLE_SAMPLE_TITLE_SAMPLE` (`sample_id`),
KEY `DOWNLOADABLE_SAMPLE_TITLE_STORE` (`store_id`),
CONSTRAINT `FK_DOWNLOADABLE_SAMPLE_TITLE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_DOWNLOADABLE_SAMPLE_TITLE_SAMPLE` FOREIGN KEY (`sample_id`) REFERENCES `downloadable_sample` (`sample_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_attribute`
--

DROP TABLE IF EXISTS `eav_attribute`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_attribute` (
`attribute_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_code` varchar(255) NOT NULL DEFAULT '',
`attribute_model` varchar(255) DEFAULT NULL,
`backend_model` varchar(255) DEFAULT NULL,
`backend_type` enum('static','datetime','decimal','int','text','varchar') NOT NULL DEFAULT 'static',
`backend_table` varchar(255) DEFAULT NULL,
`frontend_model` varchar(255) DEFAULT NULL,
`frontend_input` varchar(50) DEFAULT NULL,
`frontend_label` varchar(255) DEFAULT NULL,
`frontend_class` varchar(255) DEFAULT NULL,
`source_model` varchar(255) DEFAULT NULL,
`is_required` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_user_defined` tinyint(1) unsigned NOT NULL DEFAULT '0',
`default_value` text,
`is_unique` tinyint(1) unsigned NOT NULL DEFAULT '0',
`note` varchar(255) NOT NULL,
PRIMARY KEY (`attribute_id`),
UNIQUE KEY `entity_type_id` (`entity_type_id`,`attribute_code`),
KEY `IDX_USED_FOR_SORT_BY` (`entity_type_id`),
KEY `IDX_USED_IN_PRODUCT_LISTING` (`entity_type_id`),
CONSTRAINT `FK_eav_attribute` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=525 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_attribute_group`
--

DROP TABLE IF EXISTS `eav_attribute_group`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_attribute_group` (
`attribute_group_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`attribute_set_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_group_name` varchar(255) NOT NULL DEFAULT '',
`sort_order` smallint(6) NOT NULL DEFAULT '0',
`default_id` smallint(5) unsigned DEFAULT '0',
PRIMARY KEY (`attribute_group_id`),
UNIQUE KEY `attribute_set_id` (`attribute_set_id`,`attribute_group_name`),
KEY `attribute_set_id_2` (`attribute_set_id`,`sort_order`),
CONSTRAINT `FK_eav_attribute_group` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_attribute_label`
--

DROP TABLE IF EXISTS `eav_attribute_label`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_attribute_label` (
`attribute_label_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`attribute_label_id`),
KEY `IDX_ATTRIBUTE_LABEL_ATTRIBUTE` (`attribute_id`),
KEY `IDX_ATTRIBUTE_LABEL_STORE` (`store_id`),
KEY `IDX_ATTRIBUTE_LABEL_ATTRIBUTE_STORE` (`attribute_id`,`store_id`),
CONSTRAINT `FK_ATTRIBUTE_LABEL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_ATTRIBUTE_LABEL_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_attribute_option`
--

DROP TABLE IF EXISTS `eav_attribute_option`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_attribute_option` (
`option_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`sort_order` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`option_id`),
KEY `FK_ATTRIBUTE_OPTION_ATTRIBUTE` (`attribute_id`),
CONSTRAINT `FK_ATTRIBUTE_OPTION_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='Attributes option (for source model)';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_attribute_option_value`
--

DROP TABLE IF EXISTS `eav_attribute_option_value`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_attribute_option_value` (
`value_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`option_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`value_id`),
KEY `FK_ATTRIBUTE_OPTION_VALUE_OPTION` (`option_id`),
KEY `FK_ATTRIBUTE_OPTION_VALUE_STORE` (`store_id`),
CONSTRAINT `FK_ATTRIBUTE_OPTION_VALUE_OPTION` FOREIGN KEY (`option_id`) REFERENCES `eav_attribute_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_ATTRIBUTE_OPTION_VALUE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='Attribute option values per store';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_attribute_set`
--

DROP TABLE IF EXISTS `eav_attribute_set`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_attribute_set` (
`attribute_set_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_set_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_swedish_ci NOT NULL DEFAULT '',
`sort_order` smallint(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`attribute_set_id`),
UNIQUE KEY `entity_type_id` (`entity_type_id`,`attribute_set_name`),
KEY `entity_type_id_2` (`entity_type_id`,`sort_order`),
CONSTRAINT `FK_eav_attribute_set` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_entity`
--

DROP TABLE IF EXISTS `eav_entity`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_entity` (
`entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_set_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`increment_id` varchar(50) NOT NULL DEFAULT '',
`parent_id` int(11) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`is_active` tinyint(1) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`entity_id`),
KEY `FK_ENTITY_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_ENTITY_STORE` (`store_id`),
CONSTRAINT `FK_eav_entity` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_eav_entity_store` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Entityies';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_entity_attribute`
--

DROP TABLE IF EXISTS `eav_entity_attribute`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_entity_attribute` (
`entity_attribute_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_set_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_group_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`sort_order` smallint(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`entity_attribute_id`),
UNIQUE KEY `attribute_set_id_2` (`attribute_set_id`,`attribute_id`),
UNIQUE KEY `attribute_group_id` (`attribute_group_id`,`attribute_id`),
KEY `attribute_set_id_3` (`attribute_set_id`,`sort_order`),
KEY `FK_EAV_ENTITY_ATTRIVUTE_ATTRIBUTE` (`attribute_id`),
CONSTRAINT `FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_ENTITY_ATTRIBUTE_GROUP` FOREIGN KEY (`attribute_group_id`) REFERENCES `eav_attribute_group` (`attribute_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=523 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_entity_datetime`
--

DROP TABLE IF EXISTS `eav_entity_datetime`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_entity_datetime` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`value_id`),
KEY `FK_ATTRIBUTE_DATETIME_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_ATTRIBUTE_DATETIME_ATTRIBUTE` (`attribute_id`),
KEY `FK_ATTRIBUTE_DATETIME_STORE` (`store_id`),
KEY `FK_ATTRIBUTE_DATETIME_ENTITY` (`entity_id`),
KEY `value_by_attribute` (`attribute_id`,`value`),
KEY `value_by_entity_type` (`entity_type_id`,`value`),
CONSTRAINT `FK_EAV_ENTITY_DATETIME_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `eav_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_ENTITY_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_ENTITY_DATETIME_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Datetime values of attributes';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_entity_decimal`
--

DROP TABLE IF EXISTS `eav_entity_decimal`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_entity_decimal` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`value_id`),
KEY `FK_ATTRIBUTE_DECIMAL_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_ATTRIBUTE_DECIMAL_ATTRIBUTE` (`attribute_id`),
KEY `FK_ATTRIBUTE_DECIMAL_STORE` (`store_id`),
KEY `FK_ATTRIBUTE_DECIMAL_ENTITY` (`entity_id`),
KEY `value_by_attribute` (`attribute_id`,`value`),
KEY `value_by_entity_type` (`entity_type_id`,`value`),
CONSTRAINT `FK_EAV_ENTITY_DECIMAL_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `eav_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_ENTITY_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_ENTITY_DECIMAL_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Decimal values of attributes';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_entity_int`
--

DROP TABLE IF EXISTS `eav_entity_int`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_entity_int` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`value_id`),
KEY `FK_ATTRIBUTE_INT_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_ATTRIBUTE_INT_ATTRIBUTE` (`attribute_id`),
KEY `FK_ATTRIBUTE_INT_STORE` (`store_id`),
KEY `FK_ATTRIBUTE_INT_ENTITY` (`entity_id`),
KEY `value_by_attribute` (`attribute_id`,`value`),
KEY `value_by_entity_type` (`entity_type_id`,`value`),
CONSTRAINT `FK_EAV_ENTITY_INT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `eav_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_ENTITY_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_ENTITY_INT_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Integer values of attributes';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_entity_store`
--

DROP TABLE IF EXISTS `eav_entity_store`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_entity_store` (
`entity_store_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`increment_prefix` varchar(20) NOT NULL DEFAULT '',
`increment_last_id` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`entity_store_id`),
KEY `FK_eav_entity_store_entity_type` (`entity_type_id`),
KEY `FK_eav_entity_store_store` (`store_id`),
CONSTRAINT `FK_eav_entity_store_entity_type` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_eav_entity_store_store` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_entity_text`
--

DROP TABLE IF EXISTS `eav_entity_text`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_entity_text` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` text NOT NULL,
PRIMARY KEY (`value_id`),
KEY `FK_ATTRIBUTE_TEXT_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_ATTRIBUTE_TEXT_ATTRIBUTE` (`attribute_id`),
KEY `FK_ATTRIBUTE_TEXT_STORE` (`store_id`),
KEY `FK_ATTRIBUTE_TEXT_ENTITY` (`entity_id`),
CONSTRAINT `FK_EAV_ENTITY_TEXT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `eav_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_ENTITY_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_ENTITY_TEXT_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Text values of attributes';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_entity_type`
--

DROP TABLE IF EXISTS `eav_entity_type`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_entity_type` (
`entity_type_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`entity_type_code` varchar(50) NOT NULL DEFAULT '',
`entity_model` varchar(255) NOT NULL,
`attribute_model` varchar(255) NOT NULL,
`entity_table` varchar(255) NOT NULL DEFAULT '',
`value_table_prefix` varchar(255) NOT NULL DEFAULT '',
`entity_id_field` varchar(255) NOT NULL DEFAULT '',
`is_data_sharing` tinyint(4) unsigned NOT NULL DEFAULT '1',
`data_sharing_key` varchar(100) DEFAULT 'default',
`default_attribute_set_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`increment_model` varchar(255) NOT NULL DEFAULT '',
`increment_per_store` tinyint(1) unsigned NOT NULL DEFAULT '0',
`increment_pad_length` tinyint(8) unsigned NOT NULL DEFAULT '8',
`increment_pad_char` char(1) NOT NULL DEFAULT '0',
`additional_attribute_table` varchar(255) NOT NULL DEFAULT '',
`entity_attribute_collection` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`entity_type_id`),
KEY `entity_name` (`entity_type_code`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_entity_varchar`
--

DROP TABLE IF EXISTS `eav_entity_varchar`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_entity_varchar` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`value_id`),
KEY `FK_ATTRIBUTE_VARCHAR_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_ATTRIBUTE_VARCHAR_ATTRIBUTE` (`attribute_id`),
KEY `FK_ATTRIBUTE_VARCHAR_STORE` (`store_id`),
KEY `FK_ATTRIBUTE_VARCHAR_ENTITY` (`entity_id`),
KEY `value_by_attribute` (`attribute_id`,`value`),
KEY `value_by_entity_type` (`entity_type_id`,`value`),
CONSTRAINT `FK_EAV_ENTITY_VARCHAR_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `eav_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_ENTITY_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_ENTITY_VARCHAR_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Varchar values of attributes';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_form_element`
--

DROP TABLE IF EXISTS `eav_form_element`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_form_element` (
`element_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`type_id` smallint(5) unsigned NOT NULL,
`fieldset_id` smallint(5) unsigned DEFAULT NULL,
`attribute_id` smallint(5) unsigned NOT NULL,
`sort_order` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`element_id`),
UNIQUE KEY `UNQ_FORM_ATTRIBUTE` (`type_id`,`attribute_id`),
KEY `IDX_FORM_TYPE` (`type_id`),
KEY `IDX_FORM_FIELDSET` (`fieldset_id`),
KEY `IDX_FORM_ATTRIBUTE` (`attribute_id`),
CONSTRAINT `FK_EAV_FORM_ELEMENT_FORM_TYPE` FOREIGN KEY (`type_id`) REFERENCES `eav_form_type` (`type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_FORM_ELEMENT_FORM_FIELDSET` FOREIGN KEY (`fieldset_id`) REFERENCES `eav_form_fieldset` (`fieldset_id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_FORM_ELEMENT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=69 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_form_fieldset`
--

DROP TABLE IF EXISTS `eav_form_fieldset`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_form_fieldset` (
`fieldset_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`type_id` smallint(5) unsigned NOT NULL,
`code` char(64) NOT NULL,
`sort_order` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`fieldset_id`),
UNIQUE KEY `UNQ_FORM_FIELDSET_CODE` (`type_id`,`code`),
KEY `IDX_FORM_TYPE` (`type_id`),
CONSTRAINT `FK_EAV_FORM_FIELDSET_FORM_TYPE` FOREIGN KEY (`type_id`) REFERENCES `eav_form_type` (`type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_form_fieldset_label`
--

DROP TABLE IF EXISTS `eav_form_fieldset_label`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_form_fieldset_label` (
`fieldset_id` smallint(5) unsigned NOT NULL,
`store_id` smallint(5) unsigned NOT NULL,
`label` varchar(255) NOT NULL,
PRIMARY KEY (`fieldset_id`,`store_id`),
KEY `IDX_FORM_FIELDSET` (`fieldset_id`),
KEY `IDX_STORE` (`store_id`),
CONSTRAINT `FK_EAV_FORM_FIELDSET_LABEL_FORM_FIELDSET` FOREIGN KEY (`fieldset_id`) REFERENCES `eav_form_fieldset` (`fieldset_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_FORM_FIELDSET_LABEL_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_form_type`
--

DROP TABLE IF EXISTS `eav_form_type`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_form_type` (
`type_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`code` char(64) NOT NULL,
`label` varchar(255) NOT NULL,
`is_system` tinyint(1) unsigned NOT NULL DEFAULT '0',
`theme` varchar(64) NOT NULL DEFAULT '',
`store_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`type_id`),
UNIQUE KEY `UNQ_FORM_TYPE_CODE` (`code`,`theme`,`store_id`),
KEY `IDX_STORE` (`store_id`),
CONSTRAINT `FK_EAV_FORM_TYPE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `eav_form_type_entity`
--

DROP TABLE IF EXISTS `eav_form_type_entity`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `eav_form_type_entity` (
`type_id` smallint(5) unsigned NOT NULL,
`entity_type_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`type_id`,`entity_type_id`),
KEY `IDX_EAV_ENTITY_TYPE` (`entity_type_id`),
CONSTRAINT `FK_EAV_FORM_TYPE_ENTITY_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_EAV_FORM_TYPE_ENTITY_FORM_TYPE` FOREIGN KEY (`type_id`) REFERENCES `eav_form_type` (`type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `gift_message`
--

DROP TABLE IF EXISTS `gift_message`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `gift_message` (
`gift_message_id` int(7) unsigned NOT NULL AUTO_INCREMENT,
`customer_id` int(7) unsigned NOT NULL DEFAULT '0',
`sender` varchar(255) NOT NULL DEFAULT '',
`recipient` varchar(255) NOT NULL DEFAULT '',
`message` text NOT NULL,
PRIMARY KEY (`gift_message_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `googlebase_attributes`
--

DROP TABLE IF EXISTS `googlebase_attributes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `googlebase_attributes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`attribute_id` smallint(5) unsigned NOT NULL,
`gbase_attribute` varchar(255) NOT NULL,
`type_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`id`),
KEY `GOOGLEBASE_ATTRIBUTES_ATTRIBUTE_ID` (`attribute_id`),
KEY `GOOGLEBASE_ATTRIBUTES_TYPE_ID` (`type_id`),
CONSTRAINT `GOOGLEBASE_ATTRIBUTES_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE,
CONSTRAINT `GOOGLEBASE_ATTRIBUTES_TYPE_ID` FOREIGN KEY (`type_id`) REFERENCES `googlebase_types` (`type_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Google Base Attributes link Product Attributes';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `googlebase_items`
--

DROP TABLE IF EXISTS `googlebase_items`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `googlebase_items` (
`item_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`type_id` int(10) unsigned NOT NULL DEFAULT '0',
`product_id` int(10) unsigned NOT NULL,
`gbase_item_id` varchar(255) NOT NULL,
`store_id` smallint(5) unsigned NOT NULL,
`published` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`expires` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`impr` smallint(5) unsigned NOT NULL DEFAULT '0',
`clicks` smallint(5) unsigned NOT NULL DEFAULT '0',
`views` smallint(5) unsigned NOT NULL DEFAULT '0',
`is_hidden` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`item_id`),
KEY `GOOGLEBASE_ITEMS_PRODUCT_ID` (`product_id`),
KEY `GOOGLEBASE_ITEMS_STORE_ID` (`store_id`),
CONSTRAINT `GOOGLEBASE_ITEMS_PRODUCT_ID` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
CONSTRAINT `GOOGLEBASE_ITEMS_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Google Base Items Products';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `googlebase_types`
--

DROP TABLE IF EXISTS `googlebase_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `googlebase_types` (
`type_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`attribute_set_id` smallint(5) unsigned NOT NULL,
`gbase_itemtype` varchar(255) NOT NULL,
`target_country` varchar(2) NOT NULL DEFAULT 'US',
PRIMARY KEY (`type_id`),
KEY `GOOGLEBASE_TYPES_ATTRIBUTE_SET_ID` (`attribute_set_id`),
CONSTRAINT `GOOGLEBASE_TYPES_ATTRIBUTE_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Google Base Item Types link Attribute Sets';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `googlecheckout_api_debug`
--

DROP TABLE IF EXISTS `googlecheckout_api_debug`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `googlecheckout_api_debug` (
`debug_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`dir` enum('in','out') DEFAULT NULL,
`url` varchar(255) DEFAULT NULL,
`request_body` text,
`response_body` text,
PRIMARY KEY (`debug_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `googleoptimizer_code`
--

DROP TABLE IF EXISTS `googleoptimizer_code`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `googleoptimizer_code` (
`code_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entity_id` int(10) unsigned NOT NULL,
`entity_type` varchar(50) NOT NULL DEFAULT '',
`store_id` smallint(5) unsigned NOT NULL,
`control_script` text,
`tracking_script` text,
`conversion_script` text,
`conversion_page` varchar(255) NOT NULL DEFAULT '',
`additional_data` text,
PRIMARY KEY (`code_id`),
KEY `GOOGLEOPTIMIZER_CODE_STORE` (`store_id`),
CONSTRAINT `FK_GOOGLEOPTIMIZER_CODE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `index_event`
--

DROP TABLE IF EXISTS `index_event`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `index_event` (
`event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(64) NOT NULL,
`entity` varchar(64) NOT NULL,
`entity_pk` bigint(20) DEFAULT NULL,
`created_at` datetime NOT NULL,
`old_data` mediumtext,
`new_data` mediumtext,
PRIMARY KEY (`event_id`),
UNIQUE KEY `IDX_UNIQUE_EVENT` (`type`,`entity`,`entity_pk`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `index_process`
--

DROP TABLE IF EXISTS `index_process`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `index_process` (
`process_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`indexer_code` varchar(32) NOT NULL,
`status` enum('pending','working','require_reindex') NOT NULL DEFAULT 'pending',
`started_at` datetime DEFAULT NULL,
`ended_at` datetime DEFAULT NULL,
`mode` enum('real_time','manual') NOT NULL DEFAULT 'real_time',
PRIMARY KEY (`process_id`),
UNIQUE KEY `IDX_CODE` (`indexer_code`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `index_process_event`
--

DROP TABLE IF EXISTS `index_process_event`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `index_process_event` (
`process_id` int(10) unsigned NOT NULL,
`event_id` bigint(20) unsigned NOT NULL,
`status` enum('new','working','done','error') NOT NULL DEFAULT 'new',
PRIMARY KEY (`process_id`,`event_id`),
KEY `FK_INDEX_EVNT_PROCESS` (`event_id`),
CONSTRAINT `FK_INDEX_EVNT_PROCESS` FOREIGN KEY (`event_id`) REFERENCES `index_event` (`event_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_INDEX_PROCESS_EVENT` FOREIGN KEY (`process_id`) REFERENCES `index_process` (`process_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `log_customer`
--

DROP TABLE IF EXISTS `log_customer`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log_customer` (
`log_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`visitor_id` bigint(20) unsigned DEFAULT NULL,
`customer_id` int(11) NOT NULL DEFAULT '0',
`login_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`logout_at` datetime DEFAULT NULL,
`store_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`log_id`),
KEY `IDX_VISITOR` (`visitor_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Customers log information';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `log_quote`
--

DROP TABLE IF EXISTS `log_quote`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log_quote` (
`quote_id` int(10) unsigned NOT NULL DEFAULT '0',
`visitor_id` bigint(20) unsigned DEFAULT NULL,
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`quote_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Quote log data';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `log_summary`
--

DROP TABLE IF EXISTS `log_summary`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log_summary` (
`summary_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`store_id` smallint(5) unsigned NOT NULL,
`type_id` smallint(5) unsigned DEFAULT NULL,
`visitor_count` int(11) NOT NULL DEFAULT '0',
`customer_count` int(11) NOT NULL DEFAULT '0',
`add_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`summary_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Summary log information';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `log_summary_type`
--

DROP TABLE IF EXISTS `log_summary_type`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log_summary_type` (
`type_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`type_code` varchar(64) NOT NULL DEFAULT '',
`period` smallint(5) unsigned NOT NULL DEFAULT '0',
`period_type` enum('MINUTE','HOUR','DAY','WEEK','MONTH') NOT NULL DEFAULT 'MINUTE',
PRIMARY KEY (`type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='Type of summary information';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `log_url`
--

DROP TABLE IF EXISTS `log_url`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log_url` (
`url_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`visitor_id` bigint(20) unsigned DEFAULT NULL,
`visit_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`url_id`),
KEY `IDX_VISITOR` (`visitor_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='URL visiting history';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `log_url_info`
--

DROP TABLE IF EXISTS `log_url_info`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log_url_info` (
`url_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`url` varchar(255) NOT NULL DEFAULT '',
`referer` varchar(255) DEFAULT NULL,
PRIMARY KEY (`url_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='Detale information about url visit';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `log_visitor`
--

DROP TABLE IF EXISTS `log_visitor`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log_visitor` (
`visitor_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`session_id` char(64) NOT NULL DEFAULT '',
`first_visit_at` datetime DEFAULT NULL,
`last_visit_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`last_url_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`visitor_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='System visitors log';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `log_visitor_info`
--

DROP TABLE IF EXISTS `log_visitor_info`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log_visitor_info` (
`visitor_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`http_referer` varchar(255) DEFAULT NULL,
`http_user_agent` varchar(255) DEFAULT NULL,
`http_accept_charset` varchar(255) DEFAULT NULL,
`http_accept_language` varchar(255) DEFAULT NULL,
`server_addr` bigint(20) DEFAULT NULL,
`remote_addr` bigint(20) DEFAULT NULL,
PRIMARY KEY (`visitor_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Additional information by visitor';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `log_visitor_online`
--

DROP TABLE IF EXISTS `log_visitor_online`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `log_visitor_online` (
`visitor_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`visitor_type` char(1) NOT NULL,
`remote_addr` bigint(20) NOT NULL,
`first_visit_at` datetime DEFAULT NULL,
`last_visit_at` datetime DEFAULT NULL,
`customer_id` int(10) unsigned DEFAULT NULL,
`last_url` varchar(255) DEFAULT NULL,
PRIMARY KEY (`visitor_id`),
KEY `IDX_VISITOR_TYPE` (`visitor_type`),
KEY `IDX_VISIT_TIME` (`first_visit_at`,`last_visit_at`),
KEY `IDX_CUSTOMER` (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `newsletter_problem`
--

DROP TABLE IF EXISTS `newsletter_problem`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `newsletter_problem` (
`problem_id` int(7) unsigned NOT NULL AUTO_INCREMENT,
`subscriber_id` int(7) unsigned DEFAULT NULL,
`queue_id` int(7) unsigned NOT NULL DEFAULT '0',
`problem_error_code` int(3) unsigned DEFAULT '0',
`problem_error_text` varchar(200) DEFAULT NULL,
PRIMARY KEY (`problem_id`),
KEY `FK_PROBLEM_SUBSCRIBER` (`subscriber_id`),
KEY `FK_PROBLEM_QUEUE` (`queue_id`),
CONSTRAINT `FK_PROBLEM_QUEUE` FOREIGN KEY (`queue_id`) REFERENCES `newsletter_queue` (`queue_id`),
CONSTRAINT `FK_PROBLEM_SUBSCRIBER` FOREIGN KEY (`subscriber_id`) REFERENCES `newsletter_subscriber` (`subscriber_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter problems';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `newsletter_queue`
--

DROP TABLE IF EXISTS `newsletter_queue`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `newsletter_queue` (
`queue_id` int(7) unsigned NOT NULL AUTO_INCREMENT,
`template_id` int(7) unsigned NOT NULL DEFAULT '0',
`queue_status` int(3) unsigned NOT NULL DEFAULT '0',
`queue_start_at` datetime DEFAULT NULL,
`queue_finish_at` datetime DEFAULT NULL,
PRIMARY KEY (`queue_id`),
KEY `FK_QUEUE_TEMPLATE` (`template_id`),
CONSTRAINT `FK_QUEUE_TEMPLATE` FOREIGN KEY (`template_id`) REFERENCES `newsletter_template` (`template_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter queue';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `newsletter_queue_link`
--

DROP TABLE IF EXISTS `newsletter_queue_link`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `newsletter_queue_link` (
`queue_link_id` int(9) unsigned NOT NULL AUTO_INCREMENT,
`queue_id` int(7) unsigned NOT NULL DEFAULT '0',
`subscriber_id` int(7) unsigned NOT NULL DEFAULT '0',
`letter_sent_at` datetime DEFAULT NULL,
PRIMARY KEY (`queue_link_id`),
KEY `FK_QUEUE_LINK_SUBSCRIBER` (`subscriber_id`),
KEY `FK_QUEUE_LINK_QUEUE` (`queue_id`),
KEY `IDX_NEWSLETTER_QUEUE_LINK_SEND_AT` (`queue_id`,`letter_sent_at`),
CONSTRAINT `FK_QUEUE_LINK_QUEUE` FOREIGN KEY (`queue_id`) REFERENCES `newsletter_queue` (`queue_id`) ON DELETE CASCADE,
CONSTRAINT `FK_QUEUE_LINK_SUBSCRIBER` FOREIGN KEY (`subscriber_id`) REFERENCES `newsletter_subscriber` (`subscriber_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter queue to subscriber link';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `newsletter_queue_store_link`
--

DROP TABLE IF EXISTS `newsletter_queue_store_link`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `newsletter_queue_store_link` (
`queue_id` int(7) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`queue_id`,`store_id`),
KEY `FK_NEWSLETTER_QUEUE_STORE_LINK_STORE` (`store_id`),
CONSTRAINT `FK_NEWSLETTER_QUEUE_STORE_LINK_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_LINK_QUEUE` FOREIGN KEY (`queue_id`) REFERENCES `newsletter_queue` (`queue_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `newsletter_subscriber`
--

DROP TABLE IF EXISTS `newsletter_subscriber`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `newsletter_subscriber` (
`subscriber_id` int(7) unsigned NOT NULL AUTO_INCREMENT,
`store_id` smallint(5) unsigned DEFAULT '0',
`change_status_at` datetime DEFAULT NULL,
`customer_id` int(11) unsigned NOT NULL DEFAULT '0',
`subscriber_email` varchar(150) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT '',
`subscriber_status` int(3) NOT NULL DEFAULT '0',
`subscriber_confirm_code` varchar(32) DEFAULT 'NULL',
PRIMARY KEY (`subscriber_id`),
KEY `FK_SUBSCRIBER_CUSTOMER` (`customer_id`),
KEY `FK_NEWSLETTER_SUBSCRIBER_STORE` (`store_id`),
CONSTRAINT `FK_NEWSLETTER_SUBSCRIBER_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter subscribers';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `newsletter_template`
--

DROP TABLE IF EXISTS `newsletter_template`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `newsletter_template` (
`template_id` int(7) unsigned NOT NULL AUTO_INCREMENT,
`template_code` varchar(150) DEFAULT NULL,
`template_text` text,
`template_text_preprocessed` text,
`template_styles` text,
`template_type` int(3) unsigned DEFAULT NULL,
`template_subject` varchar(200) DEFAULT NULL,
`template_sender_name` varchar(200) DEFAULT NULL,
`template_sender_email` varchar(200) CHARACTER SET latin1 COLLATE latin1_general_ci DEFAULT NULL,
`template_actual` tinyint(1) unsigned DEFAULT '1',
`added_at` datetime DEFAULT NULL,
`modified_at` datetime DEFAULT NULL,
PRIMARY KEY (`template_id`),
KEY `template_actual` (`template_actual`),
KEY `added_at` (`added_at`),
KEY `modified_at` (`modified_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter templates';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `paygate_authorizenet_debug`
--

DROP TABLE IF EXISTS `paygate_authorizenet_debug`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `paygate_authorizenet_debug` (
`debug_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`request_body` text,
`response_body` text,
`request_serialized` text,
`result_serialized` text,
`request_dump` text,
`result_dump` text,
PRIMARY KEY (`debug_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `paypal_api_debug`
--

DROP TABLE IF EXISTS `paypal_api_debug`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `paypal_api_debug` (
`debug_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`debug_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`request_body` text,
`response_body` text,
PRIMARY KEY (`debug_id`),
KEY `debug_at` (`debug_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `paypaluk_api_debug`
--

DROP TABLE IF EXISTS `paypaluk_api_debug`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `paypaluk_api_debug` (
`debug_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`debug_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`request_body` text,
`response_body` text,
PRIMARY KEY (`debug_id`),
KEY `debug_at` (`debug_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `poll`
--

DROP TABLE IF EXISTS `poll`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll` (
`poll_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`poll_title` varchar(255) NOT NULL DEFAULT '',
`votes_count` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned DEFAULT '0',
`date_posted` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`date_closed` datetime DEFAULT NULL,
`active` smallint(6) NOT NULL DEFAULT '1',
`closed` tinyint(1) NOT NULL DEFAULT '0',
`answers_display` smallint(6) DEFAULT NULL,
PRIMARY KEY (`poll_id`),
KEY `FK_POLL_STORE` (`store_id`),
CONSTRAINT `FK_POLL_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `poll_answer`
--

DROP TABLE IF EXISTS `poll_answer`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_answer` (
`answer_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`poll_id` int(10) unsigned NOT NULL DEFAULT '0',
`answer_title` varchar(255) NOT NULL DEFAULT '',
`votes_count` int(10) unsigned NOT NULL DEFAULT '0',
`answer_order` smallint(6) NOT NULL DEFAULT '0',
PRIMARY KEY (`answer_id`),
KEY `FK_POLL_PARENT` (`poll_id`),
CONSTRAINT `FK_POLL_PARENT` FOREIGN KEY (`poll_id`) REFERENCES `poll` (`poll_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `poll_store`
--

DROP TABLE IF EXISTS `poll_store`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_store` (
`poll_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`poll_id`,`store_id`),
KEY `FK_POLL_STORE_STORE` (`store_id`),
CONSTRAINT `FK_POLL_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_POLL_STORE_POLL` FOREIGN KEY (`poll_id`) REFERENCES `poll` (`poll_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `poll_vote`
--

DROP TABLE IF EXISTS `poll_vote`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `poll_vote` (
`vote_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`poll_id` int(10) unsigned NOT NULL DEFAULT '0',
`poll_answer_id` int(10) unsigned NOT NULL DEFAULT '0',
`ip_address` bigint(20) DEFAULT NULL,
`customer_id` int(11) DEFAULT NULL,
`vote_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`vote_id`),
KEY `FK_POLL_ANSWER` (`poll_answer_id`),
CONSTRAINT `FK_POLL_ANSWER` FOREIGN KEY (`poll_answer_id`) REFERENCES `poll_answer` (`answer_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `product_alert_price`
--

DROP TABLE IF EXISTS `product_alert_price`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_alert_price` (
`alert_price_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`customer_id` int(10) unsigned NOT NULL DEFAULT '0',
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`price` decimal(12,4) NOT NULL DEFAULT '0.0000',
`website_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`add_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`last_send_date` datetime DEFAULT NULL,
`send_count` smallint(5) unsigned NOT NULL DEFAULT '0',
`status` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`alert_price_id`),
KEY `FK_PRODUCT_ALERT_PRICE_CUSTOMER` (`customer_id`),
KEY `FK_PRODUCT_ALERT_PRICE_PRODUCT` (`product_id`),
KEY `FK_PRODUCT_ALERT_PRICE_WEBSITE` (`website_id`),
CONSTRAINT `FK_PRODUCT_ALERT_PRICE_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_PRODUCT_ALERT_PRICE_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_PRODUCT_ALERT_PRICE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `product_alert_stock`
--

DROP TABLE IF EXISTS `product_alert_stock`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `product_alert_stock` (
`alert_stock_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`customer_id` int(10) unsigned NOT NULL DEFAULT '0',
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`website_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`add_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`send_date` datetime DEFAULT NULL,
`send_count` smallint(5) unsigned NOT NULL DEFAULT '0',
`status` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`alert_stock_id`),
KEY `FK_PRODUCT_ALERT_STOCK_CUSTOMER` (`customer_id`),
KEY `FK_PRODUCT_ALERT_STOCK_PRODUCT` (`product_id`),
KEY `FK_PRODUCT_ALERT_STOCK_WEBSITE` (`website_id`),
CONSTRAINT `FK_PRODUCT_ALERT_STOCK_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_PRODUCT_ALERT_STOCK_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_PRODUCT_ALERT_STOCK_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rating`
--

DROP TABLE IF EXISTS `rating`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rating` (
`rating_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
`entity_id` smallint(6) unsigned NOT NULL DEFAULT '0',
`rating_code` varchar(64) NOT NULL DEFAULT '',
`position` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`rating_id`),
UNIQUE KEY `IDX_CODE` (`rating_code`),
KEY `FK_RATING_ENTITY` (`entity_id`),
CONSTRAINT `FK_RATING_ENTITY_KEY` FOREIGN KEY (`entity_id`) REFERENCES `rating_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='ratings';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rating_entity`
--

DROP TABLE IF EXISTS `rating_entity`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rating_entity` (
`entity_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
`entity_code` varchar(64) NOT NULL DEFAULT '',
PRIMARY KEY (`entity_id`),
UNIQUE KEY `IDX_CODE` (`entity_code`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='Rating entities';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rating_option`
--

DROP TABLE IF EXISTS `rating_option`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rating_option` (
`option_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`rating_id` smallint(6) unsigned NOT NULL DEFAULT '0',
`code` varchar(32) NOT NULL DEFAULT '',
`value` tinyint(3) unsigned NOT NULL DEFAULT '0',
`position` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`option_id`),
KEY `FK_RATING_OPTION_RATING` (`rating_id`),
CONSTRAINT `FK_RATING_OPTION_RATING` FOREIGN KEY (`rating_id`) REFERENCES `rating` (`rating_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8 COMMENT='Rating options';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rating_option_vote`
--

DROP TABLE IF EXISTS `rating_option_vote`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rating_option_vote` (
`vote_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`option_id` int(10) unsigned NOT NULL DEFAULT '0',
`remote_ip` varchar(16) NOT NULL DEFAULT '',
`remote_ip_long` int(11) NOT NULL DEFAULT '0',
`customer_id` int(11) unsigned DEFAULT '0',
`entity_pk_value` bigint(20) unsigned NOT NULL DEFAULT '0',
`rating_id` smallint(6) unsigned NOT NULL DEFAULT '0',
`review_id` bigint(20) unsigned DEFAULT NULL,
`percent` tinyint(3) NOT NULL DEFAULT '0',
`value` tinyint(3) NOT NULL DEFAULT '0',
PRIMARY KEY (`vote_id`),
KEY `FK_RATING_OPTION_VALUE_OPTION` (`option_id`),
KEY `FK_RATING_OPTION_REVIEW_ID` (`review_id`),
CONSTRAINT `FK_RATING_OPTION_REVIEW_ID` FOREIGN KEY (`review_id`) REFERENCES `review` (`review_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_RATING_OPTION_VALUE_OPTION` FOREIGN KEY (`option_id`) REFERENCES `rating_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rating option values';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rating_option_vote_aggregated`
--

DROP TABLE IF EXISTS `rating_option_vote_aggregated`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rating_option_vote_aggregated` (
`primary_id` int(11) NOT NULL AUTO_INCREMENT,
`rating_id` smallint(6) unsigned NOT NULL DEFAULT '0',
`entity_pk_value` bigint(20) unsigned NOT NULL DEFAULT '0',
`vote_count` int(10) unsigned NOT NULL DEFAULT '0',
`vote_value_sum` int(10) unsigned NOT NULL DEFAULT '0',
`percent` tinyint(3) NOT NULL DEFAULT '0',
`percent_approved` tinyint(3) DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`primary_id`),
KEY `FK_RATING_OPTION_VALUE_AGGREGATE` (`rating_id`),
KEY `FK_RATING_OPTION_VOTE_AGGREGATED_STORE` (`store_id`),
CONSTRAINT `FK_RATING_OPTION_VALUE_AGGREGATE` FOREIGN KEY (`rating_id`) REFERENCES `rating` (`rating_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_RATING_OPTION_VOTE_AGGREGATED_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rating_store`
--

DROP TABLE IF EXISTS `rating_store`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rating_store` (
`rating_id` smallint(6) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`rating_id`,`store_id`),
KEY `FK_RATING_STORE_STORE` (`store_id`),
CONSTRAINT `FK_RATING_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_RATING_STORE_RATING` FOREIGN KEY (`rating_id`) REFERENCES `rating` (`rating_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `rating_title`
--

DROP TABLE IF EXISTS `rating_title`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `rating_title` (
`rating_id` smallint(6) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`rating_id`,`store_id`),
KEY `FK_RATING_TITLE_STORE` (`store_id`),
CONSTRAINT `FK_RATING_TITLE` FOREIGN KEY (`rating_id`) REFERENCES `rating` (`rating_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_RATING_TITLE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `report_compared_product_index`
--

DROP TABLE IF EXISTS `report_compared_product_index`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `report_compared_product_index` (
`index_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`visitor_id` int(10) unsigned DEFAULT NULL,
`customer_id` int(10) unsigned DEFAULT NULL,
`product_id` int(10) unsigned NOT NULL,
`store_id` smallint(5) unsigned DEFAULT NULL,
`added_at` datetime NOT NULL,
PRIMARY KEY (`index_id`),
UNIQUE KEY `UNQ_BY_VISITOR` (`visitor_id`,`product_id`),
UNIQUE KEY `UNQ_BY_CUSTOMER` (`customer_id`,`product_id`),
KEY `IDX_STORE` (`store_id`),
KEY `IDX_SORT_ADDED_AT` (`added_at`),
KEY `product_id` (`product_id`),
CONSTRAINT `FK_REPORT_COMPARED_PRODUCT_INDEX_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_REPORT_COMPARED_PRODUCT_INDEX_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_REPORT_COMPARED_PRODUCT_INDEX_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `report_event`
--

DROP TABLE IF EXISTS `report_event`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `report_event` (
`event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`logged_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`event_type_id` smallint(6) unsigned NOT NULL DEFAULT '0',
`object_id` int(10) unsigned NOT NULL DEFAULT '0',
`subject_id` int(10) unsigned NOT NULL DEFAULT '0',
`subtype` tinyint(3) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`event_id`),
KEY `IDX_EVENT_TYPE` (`event_type_id`),
KEY `IDX_SUBJECT` (`subject_id`),
KEY `IDX_OBJECT` (`object_id`),
KEY `IDX_SUBTYPE` (`subtype`),
KEY `FK_REPORT_EVENT_STORE` (`store_id`),
CONSTRAINT `FK_REPORT_EVENT_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_REPORT_EVENT_TYPE` FOREIGN KEY (`event_type_id`) REFERENCES `report_event_types` (`event_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `report_event_types`
--

DROP TABLE IF EXISTS `report_event_types`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `report_event_types` (
`event_type_id` smallint(6) unsigned NOT NULL AUTO_INCREMENT,
`event_name` varchar(64) NOT NULL,
`customer_login` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`event_type_id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `report_viewed_product_index`
--

DROP TABLE IF EXISTS `report_viewed_product_index`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `report_viewed_product_index` (
`index_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`visitor_id` int(10) unsigned DEFAULT NULL,
`customer_id` int(10) unsigned DEFAULT NULL,
`product_id` int(10) unsigned NOT NULL,
`store_id` smallint(5) unsigned DEFAULT NULL,
`added_at` datetime NOT NULL,
PRIMARY KEY (`index_id`),
UNIQUE KEY `UNQ_BY_VISITOR` (`visitor_id`,`product_id`),
UNIQUE KEY `UNQ_BY_CUSTOMER` (`customer_id`,`product_id`),
KEY `IDX_STORE` (`store_id`),
KEY `IDX_SORT_ADDED_AT` (`added_at`),
KEY `product_id` (`product_id`),
CONSTRAINT `FK_REPORT_VIEWED_PRODUCT_INDEX_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_REPORT_VIEWED_PRODUCT_INDEX_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_REPORT_VIEWED_PRODUCT_INDEX_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `review`
--

DROP TABLE IF EXISTS `review`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `review` (
`review_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`entity_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_pk_value` int(10) unsigned NOT NULL DEFAULT '0',
`status_id` tinyint(3) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`review_id`),
KEY `FK_REVIEW_ENTITY` (`entity_id`),
KEY `FK_REVIEW_STATUS` (`status_id`),
KEY `FK_REVIEW_PARENT_PRODUCT` (`entity_pk_value`),
CONSTRAINT `FK_REVIEW_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `review_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_REVIEW_STATUS` FOREIGN KEY (`status_id`) REFERENCES `review_status` (`status_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Review base information';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `review_detail`
--

DROP TABLE IF EXISTS `review_detail`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `review_detail` (
`detail_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`review_id` bigint(20) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned DEFAULT '0',
`title` varchar(255) NOT NULL DEFAULT '',
`detail` text NOT NULL,
`nickname` varchar(128) NOT NULL DEFAULT '',
`customer_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`detail_id`),
KEY `FK_REVIEW_DETAIL_REVIEW` (`review_id`),
KEY `FK_REVIEW_DETAIL_STORE` (`store_id`),
KEY `FK_REVIEW_DETAIL_CUSTOMER` (`customer_id`),
CONSTRAINT `FK_REVIEW_DETAIL_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `FK_REVIEW_DETAIL_REVIEW` FOREIGN KEY (`review_id`) REFERENCES `review` (`review_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_REVIEW_DETAIL_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Review detail information';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `review_entity`
--

DROP TABLE IF EXISTS `review_entity`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `review_entity` (
`entity_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT,
`entity_code` varchar(32) NOT NULL DEFAULT '',
PRIMARY KEY (`entity_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='Review entities';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `review_entity_summary`
--

DROP TABLE IF EXISTS `review_entity_summary`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `review_entity_summary` (
`primary_id` bigint(20) NOT NULL AUTO_INCREMENT,
`entity_pk_value` bigint(20) NOT NULL DEFAULT '0',
`entity_type` tinyint(4) NOT NULL DEFAULT '0',
`reviews_count` smallint(6) NOT NULL DEFAULT '0',
`rating_summary` tinyint(4) NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`primary_id`),
KEY `FK_REVIEW_ENTITY_SUMMARY_STORE` (`store_id`),
CONSTRAINT `FK_REVIEW_ENTITY_SUMMARY_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `review_status`
--

DROP TABLE IF EXISTS `review_status`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `review_status` (
`status_id` tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
`status_code` varchar(32) NOT NULL DEFAULT '',
PRIMARY KEY (`status_id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='Review statuses';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `review_store`
--

DROP TABLE IF EXISTS `review_store`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `review_store` (
`review_id` bigint(20) unsigned NOT NULL,
`store_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`review_id`,`store_id`),
KEY `FK_REVIEW_STORE_STORE` (`store_id`),
CONSTRAINT `FK_REVIEW_STORE_REVIEW` FOREIGN KEY (`review_id`) REFERENCES `review` (`review_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_REVIEW_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_flat_order_item`
--

DROP TABLE IF EXISTS `sales_flat_order_item`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_flat_order_item` (
`item_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`order_id` int(10) unsigned NOT NULL DEFAULT '0',
`parent_item_id` int(10) unsigned DEFAULT NULL,
`quote_item_id` int(10) unsigned DEFAULT NULL,
`store_id` smallint(5) unsigned DEFAULT NULL,
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`product_id` int(10) unsigned DEFAULT NULL,
`product_type` varchar(255) DEFAULT NULL,
`product_options` text,
`weight` decimal(12,4) DEFAULT '0.0000',
`is_virtual` tinyint(1) unsigned DEFAULT NULL,
`sku` varchar(255) NOT NULL DEFAULT '',
`name` varchar(255) DEFAULT NULL,
`description` text,
`applied_rule_ids` text,
`additional_data` text,
`free_shipping` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_qty_decimal` tinyint(1) unsigned DEFAULT NULL,
`no_discount` tinyint(1) unsigned DEFAULT '0',
`qty_backordered` decimal(12,4) DEFAULT '0.0000',
`qty_canceled` decimal(12,4) DEFAULT '0.0000',
`qty_invoiced` decimal(12,4) DEFAULT '0.0000',
`qty_ordered` decimal(12,4) DEFAULT '0.0000',
`qty_refunded` decimal(12,4) DEFAULT '0.0000',
`qty_shipped` decimal(12,4) DEFAULT '0.0000',
`base_cost` decimal(12,4) DEFAULT '0.0000',
`price` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_price` decimal(12,4) NOT NULL DEFAULT '0.0000',
`original_price` decimal(12,4) DEFAULT NULL,
`base_original_price` decimal(12,4) DEFAULT NULL,
`tax_percent` decimal(12,4) DEFAULT '0.0000',
`tax_amount` decimal(12,4) DEFAULT '0.0000',
`base_tax_amount` decimal(12,4) DEFAULT '0.0000',
`tax_invoiced` decimal(12,4) DEFAULT '0.0000',
`base_tax_invoiced` decimal(12,4) DEFAULT '0.0000',
`discount_percent` decimal(12,4) DEFAULT '0.0000',
`discount_amount` decimal(12,4) DEFAULT '0.0000',
`base_discount_amount` decimal(12,4) DEFAULT '0.0000',
`discount_invoiced` decimal(12,4) DEFAULT '0.0000',
`base_discount_invoiced` decimal(12,4) DEFAULT '0.0000',
`amount_refunded` decimal(12,4) DEFAULT '0.0000',
`base_amount_refunded` decimal(12,4) DEFAULT '0.0000',
`row_total` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_row_total` decimal(12,4) NOT NULL DEFAULT '0.0000',
`row_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_row_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000',
`row_weight` decimal(12,4) DEFAULT '0.0000',
`gift_message_id` int(10) DEFAULT NULL,
`gift_message_available` int(10) DEFAULT NULL,
`base_tax_before_discount` decimal(12,4) DEFAULT NULL,
`tax_before_discount` decimal(12,4) DEFAULT NULL,
`ext_order_item_id` varchar(255) DEFAULT NULL,
`locked_do_invoice` int(10) unsigned DEFAULT NULL,
`locked_do_ship` int(10) unsigned DEFAULT NULL,
`price_incl_tax` decimal(12,4) DEFAULT NULL,
`base_price_incl_tax` decimal(12,4) DEFAULT NULL,
`row_total_incl_tax` decimal(12,4) DEFAULT NULL,
`base_row_total_incl_tax` decimal(12,4) DEFAULT NULL,
`weee_tax_applied` text,
`weee_tax_applied_amount` decimal(12,4) DEFAULT NULL,
`weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL,
`base_weee_tax_applied_amount` decimal(12,4) DEFAULT NULL,
`base_weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL,
`weee_tax_disposition` decimal(12,4) DEFAULT NULL,
`weee_tax_row_disposition` decimal(12,4) DEFAULT NULL,
`base_weee_tax_disposition` decimal(12,4) DEFAULT NULL,
`base_weee_tax_row_disposition` decimal(12,4) DEFAULT NULL,
PRIMARY KEY (`item_id`),
KEY `IDX_ORDER` (`order_id`),
KEY `FK_SALES_ORDER_ITEM_STORE` (`store_id`),
CONSTRAINT `FK_SALES_ORDER_ITEM_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_flat_quote`
--

DROP TABLE IF EXISTS `sales_flat_quote`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_flat_quote` (
`entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`converted_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`is_active` tinyint(1) unsigned DEFAULT '1',
`is_virtual` tinyint(1) unsigned DEFAULT '0',
`is_multi_shipping` tinyint(1) unsigned DEFAULT '0',
`items_count` int(10) unsigned DEFAULT '0',
`items_qty` decimal(12,4) DEFAULT '0.0000',
`orig_order_id` int(10) unsigned DEFAULT '0',
`store_to_base_rate` decimal(12,4) DEFAULT '0.0000',
`store_to_quote_rate` decimal(12,4) DEFAULT '0.0000',
`base_currency_code` varchar(255) DEFAULT NULL,
`store_currency_code` varchar(255) DEFAULT NULL,
`quote_currency_code` varchar(255) DEFAULT NULL,
`grand_total` decimal(12,4) DEFAULT '0.0000',
`base_grand_total` decimal(12,4) DEFAULT '0.0000',
`checkout_method` varchar(255) DEFAULT NULL,
`customer_id` int(10) unsigned DEFAULT '0',
`customer_tax_class_id` int(10) unsigned DEFAULT '0',
`customer_group_id` int(10) unsigned DEFAULT '0',
`customer_email` varchar(255) DEFAULT NULL,
`customer_prefix` varchar(40) DEFAULT NULL,
`customer_firstname` varchar(255) DEFAULT NULL,
`customer_middlename` varchar(40) DEFAULT NULL,
`customer_lastname` varchar(255) DEFAULT NULL,
`customer_suffix` varchar(40) DEFAULT NULL,
`customer_dob` datetime DEFAULT NULL,
`customer_note` varchar(255) DEFAULT NULL,
`customer_note_notify` tinyint(1) unsigned DEFAULT '1',
`customer_is_guest` tinyint(1) unsigned DEFAULT '0',
`remote_ip` varchar(32) DEFAULT NULL,
`applied_rule_ids` varchar(255) DEFAULT NULL,
`reserved_order_id` varchar(64) DEFAULT '',
`password_hash` varchar(255) DEFAULT NULL,
`coupon_code` varchar(255) DEFAULT NULL,
`global_currency_code` varchar(255) DEFAULT NULL,
`base_to_global_rate` decimal(12,4) DEFAULT NULL,
`base_to_quote_rate` decimal(12,4) DEFAULT NULL,
`customer_taxvat` varchar(255) DEFAULT NULL,
`customer_gender` varchar(255) DEFAULT NULL,
`subtotal` decimal(12,4) DEFAULT NULL,
`base_subtotal` decimal(12,4) DEFAULT NULL,
`subtotal_with_discount` decimal(12,4) DEFAULT NULL,
`base_subtotal_with_discount` decimal(12,4) DEFAULT NULL,
`is_changed` int(10) unsigned DEFAULT NULL,
`trigger_recollect` tinyint(1) NOT NULL DEFAULT '0',
`ext_shipping_info` text,
`gift_message_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`entity_id`),
KEY `FK_SALES_QUOTE_STORE` (`store_id`),
KEY `IDX_CUSTOMER` (`customer_id`,`store_id`,`is_active`),
CONSTRAINT `FK_SALES_QUOTE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_flat_quote_address`
--

DROP TABLE IF EXISTS `sales_flat_quote_address`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_flat_quote_address` (
`address_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`quote_id` int(10) unsigned NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`customer_id` int(10) unsigned DEFAULT NULL,
`save_in_address_book` tinyint(1) DEFAULT '0',
`customer_address_id` int(10) unsigned DEFAULT NULL,
`address_type` varchar(255) DEFAULT NULL,
`email` varchar(255) DEFAULT NULL,
`prefix` varchar(40) DEFAULT NULL,
`firstname` varchar(255) DEFAULT NULL,
`middlename` varchar(40) DEFAULT NULL,
`lastname` varchar(255) DEFAULT NULL,
`suffix` varchar(40) DEFAULT NULL,
`company` varchar(255) DEFAULT NULL,
`street` varchar(255) DEFAULT NULL,
`city` varchar(255) DEFAULT NULL,
`region` varchar(255) DEFAULT NULL,
`region_id` int(10) unsigned DEFAULT NULL,
`postcode` varchar(255) DEFAULT NULL,
`country_id` varchar(255) DEFAULT NULL,
`telephone` varchar(255) DEFAULT NULL,
`fax` varchar(255) DEFAULT NULL,
`same_as_billing` tinyint(1) unsigned NOT NULL DEFAULT '0',
`free_shipping` tinyint(1) unsigned NOT NULL DEFAULT '0',
`collect_shipping_rates` tinyint(1) unsigned NOT NULL DEFAULT '0',
`shipping_method` varchar(255) NOT NULL DEFAULT '',
`shipping_description` varchar(255) NOT NULL DEFAULT '',
`weight` decimal(12,4) NOT NULL DEFAULT '0.0000',
`subtotal` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_subtotal` decimal(12,4) NOT NULL DEFAULT '0.0000',
`subtotal_with_discount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_subtotal_with_discount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`shipping_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_shipping_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`shipping_tax_amount` decimal(12,4) DEFAULT NULL,
`base_shipping_tax_amount` decimal(12,4) DEFAULT NULL,
`discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`grand_total` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_grand_total` decimal(12,4) NOT NULL DEFAULT '0.0000',
`customer_notes` text,
`applied_taxes` text,
`discount_description` varchar(255) DEFAULT NULL,
`shipping_discount_amount` decimal(12,4) DEFAULT NULL,
`base_shipping_discount_amount` decimal(12,4) DEFAULT NULL,
`subtotal_incl_tax` decimal(12,4) DEFAULT NULL,
`base_subtotal_total_incl_tax` decimal(12,4) DEFAULT NULL,
`gift_message_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`address_id`),
KEY `FK_SALES_QUOTE_ADDRESS_SALES_QUOTE` (`quote_id`),
CONSTRAINT `FK_SALES_QUOTE_ADDRESS_SALES_QUOTE` FOREIGN KEY (`quote_id`) REFERENCES `sales_flat_quote` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_flat_quote_address_item`
--

DROP TABLE IF EXISTS `sales_flat_quote_address_item`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_flat_quote_address_item` (
`address_item_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`parent_item_id` int(10) unsigned DEFAULT NULL,
`quote_address_id` int(10) unsigned NOT NULL DEFAULT '0',
`quote_item_id` int(10) unsigned NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`applied_rule_ids` text,
`additional_data` text,
`weight` decimal(12,4) DEFAULT '0.0000',
`qty` decimal(12,4) NOT NULL DEFAULT '0.0000',
`discount_amount` decimal(12,4) DEFAULT '0.0000',
`tax_amount` decimal(12,4) DEFAULT '0.0000',
`row_total` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_row_total` decimal(12,4) NOT NULL DEFAULT '0.0000',
`row_total_with_discount` decimal(12,4) DEFAULT '0.0000',
`base_discount_amount` decimal(12,4) DEFAULT '0.0000',
`base_tax_amount` decimal(12,4) DEFAULT '0.0000',
`row_weight` decimal(12,4) DEFAULT '0.0000',
`product_id` int(10) unsigned DEFAULT NULL,
`super_product_id` int(10) unsigned DEFAULT NULL,
`parent_product_id` int(10) unsigned DEFAULT NULL,
`sku` varchar(255) DEFAULT NULL,
`image` varchar(255) DEFAULT NULL,
`name` varchar(255) DEFAULT NULL,
`description` text,
`free_shipping` int(10) unsigned DEFAULT NULL,
`is_qty_decimal` int(10) unsigned DEFAULT NULL,
`price` decimal(12,4) DEFAULT NULL,
`discount_percent` decimal(12,4) DEFAULT NULL,
`no_discount` int(10) unsigned DEFAULT NULL,
`tax_percent` decimal(12,4) DEFAULT NULL,
`base_price` decimal(12,4) DEFAULT NULL,
`base_cost` decimal(12,4) DEFAULT NULL,
`price_incl_tax` decimal(12,4) DEFAULT NULL,
`base_price_incl_tax` decimal(12,4) DEFAULT NULL,
`row_total_incl_tax` decimal(12,4) DEFAULT NULL,
`base_row_total_incl_tax` decimal(12,4) DEFAULT NULL,
`gift_message_id` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`address_item_id`),
KEY `FK_QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS` (`quote_address_id`),
KEY `FK_SALES_QUOTE_ADDRESS_ITEM_QUOTE_ITEM` (`quote_item_id`),
KEY `IDX_PARENT_ITEM_ID` (`parent_item_id`),
CONSTRAINT `FK_QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS` FOREIGN KEY (`quote_address_id`) REFERENCES `sales_flat_quote_address` (`address_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_FLAT_QUOTE_ADDRESS_ITEM_PARENT` FOREIGN KEY (`parent_item_id`) REFERENCES `sales_flat_quote_address_item` (`address_item_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_QUOTE_ADDRESS_ITEM_QUOTE_ITEM` FOREIGN KEY (`quote_item_id`) REFERENCES `sales_flat_quote_item` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_flat_quote_item`
--

DROP TABLE IF EXISTS `sales_flat_quote_item`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_flat_quote_item` (
`item_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`quote_id` int(10) unsigned NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`product_id` int(10) unsigned DEFAULT NULL,
`store_id` smallint(5) unsigned DEFAULT NULL,
`parent_item_id` int(10) unsigned DEFAULT NULL,
`is_virtual` tinyint(1) unsigned DEFAULT NULL,
`sku` varchar(255) NOT NULL DEFAULT '',
`name` varchar(255) DEFAULT NULL,
`description` text,
`applied_rule_ids` text,
`additional_data` text,
`free_shipping` tinyint(1) unsigned NOT NULL DEFAULT '0',
`is_qty_decimal` tinyint(1) unsigned DEFAULT NULL,
`no_discount` tinyint(1) unsigned DEFAULT '0',
`weight` decimal(12,4) DEFAULT '0.0000',
`qty` decimal(12,4) NOT NULL DEFAULT '0.0000',
`price` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_price` decimal(12,4) NOT NULL DEFAULT '0.0000',
`custom_price` decimal(12,4) DEFAULT NULL,
`discount_percent` decimal(12,4) DEFAULT '0.0000',
`discount_amount` decimal(12,4) DEFAULT '0.0000',
`base_discount_amount` decimal(12,4) DEFAULT '0.0000',
`tax_percent` decimal(12,4) DEFAULT '0.0000',
`tax_amount` decimal(12,4) DEFAULT '0.0000',
`base_tax_amount` decimal(12,4) DEFAULT '0.0000',
`row_total` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_row_total` decimal(12,4) NOT NULL DEFAULT '0.0000',
`row_total_with_discount` decimal(12,4) DEFAULT '0.0000',
`row_weight` decimal(12,4) DEFAULT '0.0000',
`product_type` varchar(255) DEFAULT NULL,
`base_tax_before_discount` decimal(12,4) DEFAULT NULL,
`tax_before_discount` decimal(12,4) DEFAULT NULL,
`original_custom_price` decimal(12,4) DEFAULT NULL,
`redirect_url` varchar(255) DEFAULT NULL,
`base_cost` decimal(12,4) DEFAULT NULL,
`price_incl_tax` decimal(12,4) DEFAULT NULL,
`base_price_incl_tax` decimal(12,4) DEFAULT NULL,
`row_total_incl_tax` decimal(12,4) DEFAULT NULL,
`base_row_total_incl_tax` decimal(12,4) DEFAULT NULL,
`gift_message_id` int(10) unsigned DEFAULT NULL,
`weee_tax_applied` text,
`weee_tax_applied_amount` decimal(12,4) DEFAULT NULL,
`weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL,
`base_weee_tax_applied_amount` decimal(12,4) DEFAULT NULL,
`base_weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL,
`weee_tax_disposition` decimal(12,4) DEFAULT NULL,
`weee_tax_row_disposition` decimal(12,4) DEFAULT NULL,
`base_weee_tax_disposition` decimal(12,4) DEFAULT NULL,
`base_weee_tax_row_disposition` decimal(12,4) DEFAULT NULL,
PRIMARY KEY (`item_id`),
KEY `FK_SALES_QUOTE_ITEM_SALES_QUOTE` (`quote_id`),
KEY `FK_SALES_FLAT_QUOTE_ITEM_PARENT_ITEM` (`parent_item_id`),
KEY `FK_SALES_QUOTE_ITEM_CATALOG_PRODUCT_ENTITY` (`product_id`),
KEY `FK_SALES_QUOTE_ITEM_STORE` (`store_id`),
CONSTRAINT `FK_SALES_FLAT_QUOTE_ITEM_PARENT_ITEM` FOREIGN KEY (`parent_item_id`) REFERENCES `sales_flat_quote_item` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_QUOTE_ITEM_CATALOG_PRODUCT_ENTITY` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_QUOTE_ITEM_SALES_QUOTE` FOREIGN KEY (`quote_id`) REFERENCES `sales_flat_quote` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_QUOTE_ITEM_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_flat_quote_item_option`
--

DROP TABLE IF EXISTS `sales_flat_quote_item_option`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_flat_quote_item_option` (
`option_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`item_id` int(10) unsigned NOT NULL,
`product_id` int(10) unsigned NOT NULL,
`code` varchar(255) NOT NULL,
`value` text NOT NULL,
PRIMARY KEY (`option_id`),
KEY `FK_SALES_QUOTE_ITEM_OPTION_ITEM_ID` (`item_id`),
CONSTRAINT `FK_SALES_QUOTE_ITEM_OPTION_ITEM_ID` FOREIGN KEY (`item_id`) REFERENCES `sales_flat_quote_item` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Additional options for quote item';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_flat_quote_payment`
--

DROP TABLE IF EXISTS `sales_flat_quote_payment`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_flat_quote_payment` (
`payment_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`quote_id` int(10) unsigned NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`method` varchar(255) DEFAULT '',
`cc_type` varchar(255) DEFAULT '',
`cc_number_enc` varchar(255) DEFAULT '',
`cc_last4` varchar(255) DEFAULT '',
`cc_cid_enc` varchar(255) DEFAULT '',
`cc_owner` varchar(255) DEFAULT '',
`cc_exp_month` tinyint(2) unsigned DEFAULT '0',
`cc_exp_year` smallint(4) unsigned DEFAULT '0',
`cc_ss_owner` varchar(255) DEFAULT '',
`cc_ss_start_month` tinyint(2) unsigned DEFAULT '0',
`cc_ss_start_year` smallint(4) unsigned DEFAULT '0',
`cybersource_token` varchar(255) DEFAULT '',
`paypal_correlation_id` varchar(255) DEFAULT '',
`paypal_payer_id` varchar(255) DEFAULT '',
`paypal_payer_status` varchar(255) DEFAULT '',
`po_number` varchar(255) DEFAULT '',
`additional_data` text,
`cc_ss_issue` varchar(255) DEFAULT NULL,
`additional_information` text,
PRIMARY KEY (`payment_id`),
KEY `FK_SALES_QUOTE_PAYMENT_SALES_QUOTE` (`quote_id`),
CONSTRAINT `FK_SALES_QUOTE_PAYMENT_SALES_QUOTE` FOREIGN KEY (`quote_id`) REFERENCES `sales_flat_quote` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_flat_quote_shipping_rate`
--

DROP TABLE IF EXISTS `sales_flat_quote_shipping_rate`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_flat_quote_shipping_rate` (
`rate_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`address_id` int(10) unsigned NOT NULL DEFAULT '0',
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`carrier` varchar(255) DEFAULT NULL,
`carrier_title` varchar(255) DEFAULT NULL,
`code` varchar(255) DEFAULT NULL,
`method` varchar(255) DEFAULT NULL,
`method_description` text,
`price` decimal(12,4) NOT NULL DEFAULT '0.0000',
`error_message` text,
`method_title` text,
PRIMARY KEY (`rate_id`),
KEY `FK_SALES_QUOTE_SHIPPING_RATE_ADDRESS` (`address_id`),
CONSTRAINT `FK_SALES_QUOTE_SHIPPING_RATE_ADDRESS` FOREIGN KEY (`address_id`) REFERENCES `sales_flat_quote_address` (`address_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_invoiced_aggregated`
--

DROP TABLE IF EXISTS `sales_invoiced_aggregated`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_invoiced_aggregated` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`period` date NOT NULL DEFAULT '0000-00-00',
`store_id` smallint(5) unsigned DEFAULT NULL,
`order_status` varchar(50) NOT NULL DEFAULT '',
`orders_count` int(11) NOT NULL DEFAULT '0',
`orders_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000',
`invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000',
`invoiced_captured` decimal(12,4) NOT NULL DEFAULT '0.0000',
`invoiced_not_captured` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`id`),
UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`),
KEY `IDX_STORE_ID` (`store_id`),
CONSTRAINT `FK_SALES_INVOICED_AGGREGATED_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_invoiced_aggregated_order`
--

DROP TABLE IF EXISTS `sales_invoiced_aggregated_order`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_invoiced_aggregated_order` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`period` date NOT NULL DEFAULT '0000-00-00',
`store_id` smallint(5) unsigned DEFAULT NULL,
`order_status` varchar(50) NOT NULL DEFAULT '',
`orders_count` int(11) NOT NULL DEFAULT '0',
`orders_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000',
`invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000',
`invoiced_captured` decimal(12,4) NOT NULL DEFAULT '0.0000',
`invoiced_not_captured` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`id`),
UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`),
KEY `IDX_STORE_ID` (`store_id`),
CONSTRAINT `FK_SALES_INVOICED_AGGREGATED_ORDER_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order`
--

DROP TABLE IF EXISTS `sales_order`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order` (
`entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_set_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`increment_id` varchar(50) NOT NULL DEFAULT '',
`parent_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned DEFAULT NULL,
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`is_active` tinyint(1) unsigned NOT NULL DEFAULT '1',
`customer_id` int(10) unsigned DEFAULT NULL,
`tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`shipping_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`subtotal` decimal(12,4) NOT NULL DEFAULT '0.0000',
`grand_total` decimal(12,4) NOT NULL DEFAULT '0.0000',
`total_paid` decimal(12,4) NOT NULL DEFAULT '0.0000',
`total_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000',
`total_qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000',
`total_canceled` decimal(12,4) NOT NULL DEFAULT '0.0000',
`total_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000',
`total_online_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000',
`total_offline_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_shipping_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_subtotal` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_grand_total` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_total_paid` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_total_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_total_qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_total_canceled` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_total_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_total_online_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_total_offline_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000',
`subtotal_refunded` decimal(12,4) DEFAULT NULL,
`subtotal_canceled` decimal(12,4) DEFAULT NULL,
`discount_refunded` decimal(12,4) DEFAULT NULL,
`discount_canceled` decimal(12,4) DEFAULT NULL,
`discount_invoiced` decimal(12,4) DEFAULT NULL,
`tax_refunded` decimal(12,4) DEFAULT NULL,
`tax_canceled` decimal(12,4) DEFAULT NULL,
`shipping_refunded` decimal(12,4) DEFAULT NULL,
`shipping_canceled` decimal(12,4) DEFAULT NULL,
`base_subtotal_refunded` decimal(12,4) DEFAULT NULL,
`base_subtotal_canceled` decimal(12,4) DEFAULT NULL,
`base_discount_refunded` decimal(12,4) DEFAULT NULL,
`base_discount_canceled` decimal(12,4) DEFAULT NULL,
`base_discount_invoiced` decimal(12,4) DEFAULT NULL,
`base_tax_refunded` decimal(12,4) DEFAULT NULL,
`base_tax_canceled` decimal(12,4) DEFAULT NULL,
`base_shipping_refunded` decimal(12,4) DEFAULT NULL,
`base_shipping_canceled` decimal(12,4) DEFAULT NULL,
`subtotal_invoiced` decimal(12,4) DEFAULT NULL,
`tax_invoiced` decimal(12,4) DEFAULT NULL,
`shipping_invoiced` decimal(12,4) DEFAULT NULL,
`base_subtotal_invoiced` decimal(12,4) DEFAULT NULL,
`base_tax_invoiced` decimal(12,4) DEFAULT NULL,
`base_shipping_invoiced` decimal(12,4) DEFAULT NULL,
`shipping_tax_amount` decimal(12,4) DEFAULT NULL,
`base_shipping_tax_amount` decimal(12,4) DEFAULT NULL,
`shipping_tax_refunded` decimal(12,4) DEFAULT NULL,
`base_shipping_tax_refunded` decimal(12,4) DEFAULT NULL,
`base_total_invoiced_cost` decimal(12,4) DEFAULT NULL,
`protect_code` varchar(6) DEFAULT NULL,
`store_to_base_rate` decimal(12,4) NOT NULL DEFAULT '0.0000',
`store_to_order_rate` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_to_global_rate` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_to_order_rate` decimal(12,4) NOT NULL DEFAULT '0.0000',
`status` varchar(50) DEFAULT NULL,
`state` varchar(50) DEFAULT NULL,
`is_virtual` tinyint(1) unsigned NOT NULL DEFAULT '0',
`shipping_description` varchar(255) NOT NULL DEFAULT '',
`coupon_code` varchar(255) DEFAULT NULL,
PRIMARY KEY (`entity_id`),
KEY `FK_SALES_ORDER_TYPE` (`entity_type_id`),
KEY `FK_SALES_ORDER_STORE` (`store_id`),
KEY `IDX_CUSTOMER` (`customer_id`),
KEY `IDX_INCREMENT_ID` (`increment_id`),
CONSTRAINT `FK_SALES_ORDER_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `FK_SALE_ORDER_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `FK_SALE_ORDER_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order_aggregated_created`
--

DROP TABLE IF EXISTS `sales_order_aggregated_created`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order_aggregated_created` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`period` date NOT NULL DEFAULT '0000-00-00',
`store_id` smallint(5) unsigned DEFAULT NULL,
`order_status` varchar(50) NOT NULL DEFAULT '',
`orders_count` int(11) NOT NULL DEFAULT '0',
`total_qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_profit_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_subtotal_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_shipping_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_grand_total_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_invoiced_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_refunded_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`base_canceled_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`id`),
UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`),
KEY `IDX_STORE_ID` (`store_id`),
CONSTRAINT `FK_SALES_ORDER_AGGREGATED_CREATED` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order_datetime`
--

DROP TABLE IF EXISTS `sales_order_datetime`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order_datetime` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`value_id`),
UNIQUE KEY `UNQ_ENTITY_ATTRIBUTE_TYPE` (`entity_id`,`attribute_id`,`entity_type_id`),
KEY `FK_SALES_ORDER_DATETIME_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_SALES_ORDER_DATETIME_ATTRIBUTE` (`attribute_id`),
KEY `FK_SALES_ORDER_DATETIME` (`entity_id`),
CONSTRAINT `FK_SALES_ORDER_DATETIME` FOREIGN KEY (`entity_id`) REFERENCES `sales_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order_decimal`
--

DROP TABLE IF EXISTS `sales_order_decimal`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order_decimal` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`value_id`),
UNIQUE KEY `UNQ_ENTITY_ATTRIBUTE_TYPE` (`entity_id`,`attribute_id`,`entity_type_id`),
KEY `FK_SALES_ORDER_DECIMAL_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_SALES_ORDER_DECIMAL_ATTRIBUTE` (`attribute_id`),
KEY `FK_SALES_ORDER_DECIMAL` (`entity_id`),
CONSTRAINT `FK_SALES_ORDER_DECIMAL` FOREIGN KEY (`entity_id`) REFERENCES `sales_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order_entity`
--

DROP TABLE IF EXISTS `sales_order_entity`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order_entity` (
`entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(8) unsigned NOT NULL DEFAULT '0',
`attribute_set_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`increment_id` varchar(50) NOT NULL DEFAULT '',
`parent_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned DEFAULT NULL,
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`is_active` tinyint(1) unsigned NOT NULL DEFAULT '1',
PRIMARY KEY (`entity_id`),
KEY `FK_SALES_ORDER_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_SALES_ORDER_ENTITY_STORE` (`store_id`),
KEY `IDX_SALES_ORDER_ENTITY_PARENT` (`parent_id`),
CONSTRAINT `FK_SALES_ORDER_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALE_ORDER_ENTITY_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order_entity_datetime`
--

DROP TABLE IF EXISTS `sales_order_entity_datetime`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order_entity_datetime` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
PRIMARY KEY (`value_id`),
UNIQUE KEY `UNQ_ENTITY_ATTRIBUTE_TYPE` (`entity_id`,`attribute_id`,`entity_type_id`),
KEY `FK_SALES_ORDER_ENTITY_DATETIME_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_SALES_ORDER_ENTITY_DATETIME_ATTRIBUTE` (`attribute_id`),
KEY `FK_SALES_ORDER_ENTITY_DATETIME` (`entity_id`),
CONSTRAINT `FK_SALES_ORDER_ENTITY_DATETIME` FOREIGN KEY (`entity_id`) REFERENCES `sales_order_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_ENTITY_DATETIME_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_ENTITY_DATETIME_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order_entity_decimal`
--

DROP TABLE IF EXISTS `sales_order_entity_decimal`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order_entity_decimal` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`value_id`),
UNIQUE KEY `UNQ_ENTITY_ATTRIBUTE_TYPE` (`entity_id`,`attribute_id`,`entity_type_id`),
KEY `FK_SALES_ORDER_ENTITY_DECIMAL_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_SALES_ORDER_ENTITY_DECIMAL_ATTRIBUTE` (`attribute_id`),
KEY `FK_SALES_ORDER_ENTITY_DECIMAL` (`entity_id`),
CONSTRAINT `FK_SALES_ORDER_ENTITY_DECIMAL` FOREIGN KEY (`entity_id`) REFERENCES `sales_order_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_ENTITY_DECIMAL_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_ENTITY_DECIMAL_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order_entity_int`
--

DROP TABLE IF EXISTS `sales_order_entity_int`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order_entity_int` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`value_id`),
UNIQUE KEY `UNQ_ENTITY_ATTRIBUTE_TYPE` (`entity_id`,`attribute_id`,`entity_type_id`),
KEY `FK_SALES_ORDER_ENTITY_INT_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_SALES_ORDER_ENTITY_INT_ATTRIBUTE` (`attribute_id`),
KEY `FK_SALES_ORDER_ENTITY_INT` (`entity_id`),
CONSTRAINT `FK_SALES_ORDER_ENTITY_INT` FOREIGN KEY (`entity_id`) REFERENCES `sales_order_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_ENTITY_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_ENTITY_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order_entity_text`
--

DROP TABLE IF EXISTS `sales_order_entity_text`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order_entity_text` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` text NOT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `UNQ_ENTITY_ATTRIBUTE_TYPE` (`entity_id`,`attribute_id`,`entity_type_id`),
KEY `FK_SALES_ORDER_ENTITY_TEXT_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_SALES_ORDER_ENTITY_TEXT_ATTRIBUTE` (`attribute_id`),
KEY `FK_SALES_ORDER_ENTITY_TEXT` (`entity_id`),
CONSTRAINT `FK_SALES_ORDER_ENTITY_TEXT` FOREIGN KEY (`entity_id`) REFERENCES `sales_order_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_ENTITY_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_ENTITY_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order_entity_varchar`
--

DROP TABLE IF EXISTS `sales_order_entity_varchar`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order_entity_varchar` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`value_id`),
UNIQUE KEY `UNQ_ENTITY_ATTRIBUTE_TYPE` (`entity_id`,`attribute_id`,`entity_type_id`),
KEY `FK_SALES_ORDER_ENTITY_VARCHAR_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_SALES_ORDER_ENTITY_VARCHAR_ATTRIBUTE` (`attribute_id`),
KEY `FK_SALES_ORDER_ENTITY_VARCHAR` (`entity_id`),
CONSTRAINT `FK_SALES_ORDER_ENTITY_VARCHAR` FOREIGN KEY (`entity_id`) REFERENCES `sales_order_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_ENTITY_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_ENTITY_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order_int`
--

DROP TABLE IF EXISTS `sales_order_int`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order_int` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`value_id`),
UNIQUE KEY `UNQ_ENTITY_ATTRIBUTE_TYPE` (`entity_id`,`attribute_id`,`entity_type_id`),
KEY `FK_SALES_ORDER_INT_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_SALES_ORDER_INT_ATTRIBUTE` (`attribute_id`),
KEY `FK_SALES_ORDER_INT` (`entity_id`),
CONSTRAINT `FK_SALES_ORDER_INT` FOREIGN KEY (`entity_id`) REFERENCES `sales_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_INT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_INT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order_tax`
--

DROP TABLE IF EXISTS `sales_order_tax`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order_tax` (
`tax_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`order_id` int(10) unsigned NOT NULL,
`code` varchar(255) NOT NULL,
`title` varchar(255) NOT NULL,
`percent` decimal(12,4) NOT NULL,
`amount` decimal(12,4) NOT NULL,
`priority` int(11) NOT NULL,
`position` int(11) NOT NULL,
`base_amount` decimal(12,4) NOT NULL,
`process` smallint(6) NOT NULL,
`base_real_amount` decimal(12,4) NOT NULL,
`hidden` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`tax_id`),
KEY `IDX_ORDER_TAX` (`order_id`,`priority`,`position`),
CONSTRAINT `FK_SALES_ORDER_TAX_ORDER` FOREIGN KEY (`order_id`) REFERENCES `sales_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order_text`
--

DROP TABLE IF EXISTS `sales_order_text`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order_text` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` text NOT NULL,
PRIMARY KEY (`value_id`),
UNIQUE KEY `UNQ_ENTITY_ATTRIBUTE_TYPE` (`entity_id`,`attribute_id`,`entity_type_id`),
KEY `FK_SALES_ORDER_TEXT_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_SALES_ORDER_TEXT_ATTRIBUTE` (`attribute_id`),
KEY `FK_SALES_ORDER_TEXT` (`entity_id`),
CONSTRAINT `FK_SALES_ORDER_TEXT` FOREIGN KEY (`entity_id`) REFERENCES `sales_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_TEXT_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_TEXT_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_order_varchar`
--

DROP TABLE IF EXISTS `sales_order_varchar`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_order_varchar` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`value` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`value_id`),
UNIQUE KEY `UNQ_ENTITY_ATTRIBUTE_TYPE` (`entity_id`,`attribute_id`,`entity_type_id`),
KEY `FK_SALES_ORDER_VARCHAR_ENTITY_TYPE` (`entity_type_id`),
KEY `FK_SALES_ORDER_VARCHAR_ATTRIBUTE` (`attribute_id`),
KEY `FK_SALES_ORDER_VARCHAR` (`entity_id`),
CONSTRAINT `FK_SALES_ORDER_VARCHAR` FOREIGN KEY (`entity_id`) REFERENCES `sales_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_VARCHAR_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_ORDER_VARCHAR_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_payment_transaction`
--

DROP TABLE IF EXISTS `sales_payment_transaction`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_payment_transaction` (
`transaction_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`parent_id` int(10) unsigned DEFAULT NULL,
`order_id` int(10) unsigned NOT NULL DEFAULT '0',
`payment_id` int(10) unsigned NOT NULL DEFAULT '0',
`txn_id` varchar(100) NOT NULL DEFAULT '',
`parent_txn_id` varchar(100) DEFAULT NULL,
`txn_type` varchar(15) NOT NULL DEFAULT '',
`is_closed` tinyint(1) unsigned NOT NULL DEFAULT '1',
`additional_information` blob,
PRIMARY KEY (`transaction_id`),
UNIQUE KEY `UNQ_ORDER_PAYMENT_TXN` (`order_id`,`payment_id`,`txn_id`),
KEY `IDX_ORDER_ID` (`order_id`),
KEY `IDX_PARENT_ID` (`parent_id`),
KEY `IDX_PAYMENT_ID` (`payment_id`),
CONSTRAINT `FK_SALES_PAYMENT_TRANSACTION_PAYMENT` FOREIGN KEY (`payment_id`) REFERENCES `sales_order_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_PAYMENT_TRANSACTION_ORDER` FOREIGN KEY (`order_id`) REFERENCES `sales_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALES_PAYMENT_TRANSACTION_PARENT` FOREIGN KEY (`parent_id`) REFERENCES `sales_payment_transaction` (`transaction_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_refunded_aggregated`
--

DROP TABLE IF EXISTS `sales_refunded_aggregated`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_refunded_aggregated` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`period` date NOT NULL DEFAULT '0000-00-00',
`store_id` smallint(5) unsigned DEFAULT NULL,
`order_status` varchar(50) NOT NULL DEFAULT '',
`orders_count` int(11) NOT NULL DEFAULT '0',
`refunded` decimal(12,4) NOT NULL DEFAULT '0.0000',
`online_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000',
`offline_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`id`),
UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`),
KEY `IDX_STORE_ID` (`store_id`),
CONSTRAINT `FK_SALES_REFUNDED_AGGREGATED_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_refunded_aggregated_order`
--

DROP TABLE IF EXISTS `sales_refunded_aggregated_order`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_refunded_aggregated_order` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`period` date NOT NULL DEFAULT '0000-00-00',
`store_id` smallint(5) unsigned DEFAULT NULL,
`order_status` varchar(50) NOT NULL DEFAULT '',
`orders_count` int(11) NOT NULL DEFAULT '0',
`refunded` decimal(12,4) NOT NULL DEFAULT '0.0000',
`online_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000',
`offline_refunded` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`id`),
UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`),
KEY `IDX_STORE_ID` (`store_id`),
CONSTRAINT `FK_SALES_REFUNDED_AGGREGATED_ORDER_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_shipping_aggregated`
--

DROP TABLE IF EXISTS `sales_shipping_aggregated`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_shipping_aggregated` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`period` date NOT NULL DEFAULT '0000-00-00',
`store_id` smallint(5) unsigned DEFAULT NULL,
`order_status` varchar(50) NOT NULL DEFAULT '',
`shipping_description` varchar(255) NOT NULL DEFAULT '',
`orders_count` int(11) NOT NULL DEFAULT '0',
`total_shipping` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`id`),
UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`,`shipping_description`),
KEY `IDX_STORE_ID` (`store_id`),
CONSTRAINT `FK_SALES_SHIPPING_AGGREGATED_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sales_shipping_aggregated_order`
--

DROP TABLE IF EXISTS `sales_shipping_aggregated_order`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sales_shipping_aggregated_order` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`period` date NOT NULL DEFAULT '0000-00-00',
`store_id` smallint(5) unsigned DEFAULT NULL,
`order_status` varchar(50) NOT NULL DEFAULT '',
`shipping_description` varchar(255) NOT NULL DEFAULT '',
`orders_count` int(11) NOT NULL DEFAULT '0',
`total_shipping` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`id`),
UNIQUE KEY `UNQ_PERIOD_STORE_ORDER_STATUS` (`period`,`store_id`,`order_status`,`shipping_description`),
KEY `IDX_STORE_ID` (`store_id`),
CONSTRAINT `FK_SALES_SHIPPING_AGGREGATED_ORDER_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `salesrule`
--

DROP TABLE IF EXISTS `salesrule`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `salesrule` (
`rule_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`description` text NOT NULL,
`from_date` date DEFAULT '0000-00-00',
`to_date` date DEFAULT '0000-00-00',
`coupon_code` varchar(255) DEFAULT NULL,
`uses_per_coupon` int(11) NOT NULL DEFAULT '0',
`uses_per_customer` int(11) NOT NULL DEFAULT '0',
`customer_group_ids` varchar(255) NOT NULL DEFAULT '',
`is_active` tinyint(1) NOT NULL DEFAULT '0',
`conditions_serialized` mediumtext NOT NULL,
`actions_serialized` mediumtext NOT NULL,
`stop_rules_processing` tinyint(1) NOT NULL DEFAULT '1',
`is_advanced` tinyint(3) unsigned NOT NULL DEFAULT '1',
`product_ids` text,
`sort_order` int(10) unsigned NOT NULL DEFAULT '0',
`simple_action` varchar(32) NOT NULL DEFAULT '',
`discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000',
`discount_qty` decimal(12,4) unsigned DEFAULT NULL,
`discount_step` int(10) unsigned NOT NULL,
`simple_free_shipping` tinyint(1) unsigned NOT NULL DEFAULT '0',
`apply_to_shipping` tinyint(1) unsigned NOT NULL DEFAULT '0',
`times_used` int(11) unsigned NOT NULL DEFAULT '0',
`is_rss` tinyint(4) NOT NULL DEFAULT '0',
`website_ids` text,
PRIMARY KEY (`rule_id`),
KEY `sort_order` (`is_active`,`sort_order`,`to_date`,`from_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `salesrule_customer`
--

DROP TABLE IF EXISTS `salesrule_customer`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `salesrule_customer` (
`rule_customer_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`rule_id` int(10) unsigned NOT NULL DEFAULT '0',
`customer_id` int(10) unsigned NOT NULL DEFAULT '0',
`times_used` smallint(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`rule_customer_id`),
KEY `rule_id` (`rule_id`,`customer_id`),
KEY `customer_id` (`customer_id`,`rule_id`),
CONSTRAINT `FK_salesrule_customer_id` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_salesrule_customer_rule` FOREIGN KEY (`rule_id`) REFERENCES `salesrule` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `salesrule_label`
--

DROP TABLE IF EXISTS `salesrule_label`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `salesrule_label` (
`label_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`rule_id` int(10) unsigned NOT NULL,
`store_id` smallint(5) unsigned NOT NULL,
`label` varchar(255) DEFAULT NULL,
PRIMARY KEY (`label_id`),
UNIQUE KEY `IDX_RULE_STORE` (`rule_id`,`store_id`),
KEY `FK_SALESRULE_LABEL_STORE` (`store_id`),
KEY `FK_SALESRULE_LABEL_RULE` (`rule_id`),
CONSTRAINT `FK_SALESRULE_LABEL_RULE` FOREIGN KEY (`rule_id`) REFERENCES `salesrule` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_SALESRULE_LABEL_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sendfriend_log`
--

DROP TABLE IF EXISTS `sendfriend_log`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sendfriend_log` (
`log_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ip` bigint(20) NOT NULL DEFAULT '0',
`time` int(10) unsigned NOT NULL,
`website_id` smallint(5) NOT NULL,
PRIMARY KEY (`log_id`),
KEY `IDX_REMOTE_ADDR` (`ip`),
KEY `IDX_LOG_TIME` (`time`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='Send to friend function log storage table';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `shipping_tablerate`
--

DROP TABLE IF EXISTS `shipping_tablerate`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `shipping_tablerate` (
`pk` int(10) unsigned NOT NULL AUTO_INCREMENT,
`website_id` int(11) NOT NULL DEFAULT '0',
`dest_country_id` varchar(4) NOT NULL DEFAULT '0',
`dest_region_id` int(10) NOT NULL DEFAULT '0',
`dest_zip` varchar(10) NOT NULL DEFAULT '',
`condition_name` varchar(20) NOT NULL DEFAULT '',
`condition_value` decimal(12,4) NOT NULL DEFAULT '0.0000',
`price` decimal(12,4) NOT NULL DEFAULT '0.0000',
`cost` decimal(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`pk`),
UNIQUE KEY `dest_country` (`website_id`,`dest_country_id`,`dest_region_id`,`dest_zip`,`condition_name`,`condition_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `sitemap`
--

DROP TABLE IF EXISTS `sitemap`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `sitemap` (
`sitemap_id` int(11) NOT NULL AUTO_INCREMENT,
`sitemap_type` varchar(32) DEFAULT NULL,
`sitemap_filename` varchar(32) DEFAULT NULL,
`sitemap_path` tinytext,
`sitemap_time` timestamp NULL DEFAULT NULL,
`store_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`sitemap_id`),
KEY `FK_SITEMAP_STORE` (`store_id`),
CONSTRAINT `FK_SITEMAP_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tag`
--

DROP TABLE IF EXISTS `tag`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tag` (
`tag_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`status` smallint(6) NOT NULL DEFAULT '0',
`first_customer_id` int(10) unsigned NOT NULL DEFAULT '0',
`first_store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tag_relation`
--

DROP TABLE IF EXISTS `tag_relation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tag_relation` (
`tag_relation_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`tag_id` int(11) unsigned NOT NULL DEFAULT '0',
`customer_id` int(10) unsigned DEFAULT NULL,
`product_id` int(11) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(6) unsigned NOT NULL DEFAULT '1',
`active` tinyint(1) unsigned NOT NULL DEFAULT '1',
`created_at` datetime DEFAULT NULL,
PRIMARY KEY (`tag_relation_id`),
KEY `IDX_PRODUCT` (`product_id`),
KEY `IDX_TAG` (`tag_id`),
KEY `IDX_CUSTOMER` (`customer_id`),
KEY `IDX_STORE` (`store_id`),
CONSTRAINT `FK_TAG_RELATION_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_TAG_RELATION_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_TAG_RELATION_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_TAG_RELATION_TAG` FOREIGN KEY (`tag_id`) REFERENCES `tag` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tag_summary`
--

DROP TABLE IF EXISTS `tag_summary`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tag_summary` (
`tag_id` int(11) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`customers` int(11) unsigned NOT NULL DEFAULT '0',
`products` int(11) unsigned NOT NULL DEFAULT '0',
`uses` int(11) unsigned NOT NULL DEFAULT '0',
`historical_uses` int(11) unsigned NOT NULL DEFAULT '0',
`popularity` int(11) unsigned NOT NULL DEFAULT '0',
`base_popularity` int(11) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`tag_id`,`store_id`),
KEY `FK_TAG_SUMMARY_STORE` (`store_id`),
KEY `IDX_TAG` (`tag_id`),
CONSTRAINT `FK_TAG_SUMMARY_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_TAG_SUMMARY_TAG` FOREIGN KEY (`tag_id`) REFERENCES `tag` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tax_calculation`
--

DROP TABLE IF EXISTS `tax_calculation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tax_calculation` (
`tax_calculation_rate_id` int(11) NOT NULL,
`tax_calculation_rule_id` int(11) NOT NULL,
`customer_tax_class_id` smallint(6) NOT NULL,
`product_tax_class_id` smallint(6) NOT NULL,
KEY `FK_TAX_CALCULATION_RULE` (`tax_calculation_rule_id`),
KEY `FK_TAX_CALCULATION_RATE` (`tax_calculation_rate_id`),
KEY `FK_TAX_CALCULATION_CTC` (`customer_tax_class_id`),
KEY `FK_TAX_CALCULATION_PTC` (`product_tax_class_id`),
KEY `IDX_TAX_CALCULATION` (`tax_calculation_rate_id`,`customer_tax_class_id`,`product_tax_class_id`),
CONSTRAINT `FK_TAX_CALCULATION_PTC` FOREIGN KEY (`product_tax_class_id`) REFERENCES `tax_class` (`class_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_TAX_CALCULATION_CTC` FOREIGN KEY (`customer_tax_class_id`) REFERENCES `tax_class` (`class_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_TAX_CALCULATION_RATE` FOREIGN KEY (`tax_calculation_rate_id`) REFERENCES `tax_calculation_rate` (`tax_calculation_rate_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_TAX_CALCULATION_RULE` FOREIGN KEY (`tax_calculation_rule_id`) REFERENCES `tax_calculation_rule` (`tax_calculation_rule_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tax_calculation_rate`
--

DROP TABLE IF EXISTS `tax_calculation_rate`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tax_calculation_rate` (
`tax_calculation_rate_id` int(11) NOT NULL AUTO_INCREMENT,
`tax_country_id` char(2) NOT NULL,
`tax_region_id` mediumint(9) NOT NULL,
`tax_postcode` varchar(12) NOT NULL,
`code` varchar(255) NOT NULL,
`rate` decimal(12,4) NOT NULL,
`zip_is_range` tinyint(1) DEFAULT NULL,
`zip_from` varchar(10) DEFAULT NULL,
`zip_to` varchar(10) DEFAULT NULL,
PRIMARY KEY (`tax_calculation_rate_id`),
KEY `IDX_TAX_CALCULATION_RATE` (`tax_country_id`,`tax_region_id`,`tax_postcode`),
KEY `IDX_TAX_CALCULATION_RATE_CODE` (`code`),
KEY `IDX_TAX_CALCULATION_RATE_RANGE` (`tax_calculation_rate_id`,`tax_country_id`,`tax_region_id`,`zip_is_range`,`tax_postcode`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tax_calculation_rate_title`
--

DROP TABLE IF EXISTS `tax_calculation_rate_title`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tax_calculation_rate_title` (
`tax_calculation_rate_title_id` int(11) NOT NULL AUTO_INCREMENT,
`tax_calculation_rate_id` int(11) NOT NULL,
`store_id` smallint(5) unsigned NOT NULL,
`value` varchar(255) NOT NULL,
PRIMARY KEY (`tax_calculation_rate_title_id`),
KEY `IDX_TAX_CALCULATION_RATE_TITLE` (`tax_calculation_rate_id`,`store_id`),
KEY `FK_TAX_CALCULATION_RATE_TITLE_RATE` (`tax_calculation_rate_id`),
KEY `FK_TAX_CALCULATION_RATE_TITLE_STORE` (`store_id`),
CONSTRAINT `FK_TAX_CALCULATION_RATE_TITLE_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_TAX_CALCULATION_RATE_TITLE_RATE` FOREIGN KEY (`tax_calculation_rate_id`) REFERENCES `tax_calculation_rate` (`tax_calculation_rate_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tax_calculation_rule`
--

DROP TABLE IF EXISTS `tax_calculation_rule`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tax_calculation_rule` (
`tax_calculation_rule_id` int(11) NOT NULL AUTO_INCREMENT,
`code` varchar(255) NOT NULL,
`priority` mediumint(9) NOT NULL,
`position` mediumint(9) NOT NULL,
PRIMARY KEY (`tax_calculation_rule_id`),
KEY `IDX_TAX_CALCULATION_RULE` (`priority`,`position`,`tax_calculation_rule_id`),
KEY `IDX_TAX_CALCULATION_RULE_CODE` (`code`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tax_class`
--

DROP TABLE IF EXISTS `tax_class`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tax_class` (
`class_id` smallint(6) NOT NULL AUTO_INCREMENT,
`class_name` varchar(255) NOT NULL DEFAULT '',
`class_type` enum('CUSTOMER','PRODUCT') NOT NULL DEFAULT 'CUSTOMER',
PRIMARY KEY (`class_id`)
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `tax_order_aggregated_created`
--

DROP TABLE IF EXISTS `tax_order_aggregated_created`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `tax_order_aggregated_created` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`period` date NOT NULL DEFAULT '0000-00-00',
`store_id` smallint(5) unsigned DEFAULT NULL,
`code` varchar(255) NOT NULL DEFAULT '',
`order_status` varchar(50) NOT NULL DEFAULT '',
`percent` float(12,4) NOT NULL DEFAULT '0.0000',
`orders_count` int(11) unsigned NOT NULL DEFAULT '0',
`tax_base_amount_sum` float(12,4) NOT NULL DEFAULT '0.0000',
PRIMARY KEY (`id`),
UNIQUE KEY `UNQ_PERIOD_STORE_CODE_ORDER_STATUS` (`period`,`store_id`,`code`,`order_status`),
KEY `IDX_STORE_ID` (`store_id`),
CONSTRAINT `FK_TAX_ORDER_AGGREGATED_CREATED_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `weee_discount`
--

DROP TABLE IF EXISTS `weee_discount`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `weee_discount` (
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`website_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`customer_group_id` smallint(5) unsigned NOT NULL,
`value` decimal(12,4) NOT NULL DEFAULT '0.0000',
KEY `FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_WEBSITE` (`website_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_PRODUCT_ENTITY` (`entity_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_GROUP` (`customer_group_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_WEEE_DISCOUNT_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `weee_tax`
--

DROP TABLE IF EXISTS `weee_tax`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `weee_tax` (
`value_id` int(11) NOT NULL AUTO_INCREMENT,
`website_id` smallint(5) unsigned NOT NULL DEFAULT '0',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0',
`country` varchar(2) NOT NULL DEFAULT '',
`value` decimal(12,4) NOT NULL DEFAULT '0.0000',
`state` varchar(255) NOT NULL DEFAULT '*',
`attribute_id` smallint(5) unsigned NOT NULL,
`entity_type_id` smallint(5) unsigned NOT NULL,
PRIMARY KEY (`value_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_WEBSITE` (`website_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_PRODUCT_ENTITY` (`entity_id`),
KEY `FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_COUNTRY` (`country`),
KEY `FK_WEEE_TAX_ATTRIBUTE_ID` (`attribute_id`),
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_COUNTRY` FOREIGN KEY (`country`) REFERENCES `directory_country` (`country_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_CATALOG_PRODUCT_ENTITY_WEEE_TAX_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_WEEE_TAX_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `widget`
--

DROP TABLE IF EXISTS `widget`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `widget` (
`widget_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`code` varchar(255) NOT NULL,
`type` varchar(255) NOT NULL,
`parameters` text,
PRIMARY KEY (`widget_id`),
KEY `IDX_CODE` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Preconfigured Widgets';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `widget_instance`
--

DROP TABLE IF EXISTS `widget_instance`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `widget_instance` (
`instance_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`type` varchar(255) NOT NULL DEFAULT '',
`package_theme` varchar(255) NOT NULL DEFAULT '',
`title` varchar(255) NOT NULL DEFAULT '',
`store_ids` varchar(255) NOT NULL DEFAULT '0',
`widget_parameters` text,
`sort_order` smallint(5) NOT NULL DEFAULT '0',
PRIMARY KEY (`instance_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `widget_instance_page`
--

DROP TABLE IF EXISTS `widget_instance_page`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `widget_instance_page` (
`page_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`instance_id` int(11) unsigned NOT NULL DEFAULT '0',
`group` varchar(25) NOT NULL DEFAULT '',
`layout_handle` varchar(255) NOT NULL DEFAULT '',
`block_reference` varchar(255) NOT NULL DEFAULT '',
`for` varchar(25) NOT NULL DEFAULT '',
`entities` text,
`template` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`page_id`),
KEY `IDX_WIDGET_WIDGET_INSTANCE_ID` (`instance_id`),
CONSTRAINT `FK_WIDGET_WIDGET_INSTANCE_ID` FOREIGN KEY (`instance_id`) REFERENCES `widget_instance` (`instance_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `widget_instance_page_layout`
--

DROP TABLE IF EXISTS `widget_instance_page_layout`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `widget_instance_page_layout` (
`page_id` int(11) unsigned NOT NULL DEFAULT '0',
`layout_update_id` int(10) unsigned NOT NULL DEFAULT '0',
UNIQUE KEY `page_id` (`page_id`,`layout_update_id`),
KEY `IDX_WIDGET_WIDGET_INSTANCE_PAGE_ID` (`page_id`),
KEY `IDX_WIDGET_WIDGET_INSTANCE_LAYOUT_UPDATE_ID` (`layout_update_id`),
CONSTRAINT `FK_WIDGET_WIDGET_INSTANCE_LAYOUT_UPDATE_ID` FOREIGN KEY (`layout_update_id`) REFERENCES `core_layout_update` (`layout_update_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_WIDGET_WIDGET_INSTANCE_PAGE_ID` FOREIGN KEY (`page_id`) REFERENCES `widget_instance_page` (`page_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `wishlist`
--

DROP TABLE IF EXISTS `wishlist`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wishlist` (
`wishlist_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`customer_id` int(10) unsigned NOT NULL DEFAULT '0',
`shared` tinyint(1) unsigned DEFAULT '0',
`sharing_code` varchar(32) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT '',
PRIMARY KEY (`wishlist_id`),
UNIQUE KEY `UNQ_CUSTOMER` (`customer_id`),
KEY `IDX_IS_SHARED` (`shared`),
CONSTRAINT `FK_WISHLIST_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='Wishlist main';
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `wishlist_item`
--

DROP TABLE IF EXISTS `wishlist_item`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `wishlist_item` (
`wishlist_item_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`wishlist_id` int(10) unsigned NOT NULL DEFAULT '0',
`product_id` int(10) unsigned NOT NULL DEFAULT '0',
`store_id` smallint(5) unsigned DEFAULT NULL,
`added_at` datetime DEFAULT NULL,
`description` text,
PRIMARY KEY (`wishlist_item_id`),
KEY `IDX_WISHLIST` (`wishlist_id`),
KEY `IDX_PRODUCT` (`product_id`),
KEY `IDX_STORE` (`store_id`),
CONSTRAINT `FK_WISHLIST_ITEM_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `FK_WISHLIST_ITEM_STORE` FOREIGN KEY (`store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `FK_WISHLIST_ITEM_WISHLIST` FOREIGN KEY (`wishlist_id`) REFERENCES `wishlist` (`wishlist_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Wishlist items';
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2011-07-12 17:29:48