CREATE TABLE `#__eav_entity_datetime` (
  `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id',
  `entity_type_id` smallint(5) unsigned NOT NULL COMMENT 'Entity Type Id',
  `attribute_id` smallint(5) unsigned NOT NULL COMMENT 'Attribute Id',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store Id',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'Entity Id',
  `value` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Attribute Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `UNQ_EAV_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `IDX_EAV_ENTITY_DATETIME_ENTITY_TYPE_ID` (`entity_type_id`),
  KEY `IDX_EAV_ENTITY_DATETIME_ATTRIBUTE_ID` (`attribute_id`),
  KEY `IDX_EAV_ENTITY_DATETIME_STORE_ID` (`store_id`),
  KEY `IDX_EAV_ENTITY_DATETIME_ENTITY_ID` (`entity_id`),
  KEY `IDX_EAV_ENTITY_DATETIME_ATTRIBUTE_ID_VALUE` (`attribute_id`,`value`),
  KEY `IDX_EAV_ENTITY_DATETIME_ENTITY_TYPE_ID_VALUE` (`entity_type_id`,`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Eav Entity Value Prefix';


CREATE TABLE `#__eav_entity_decimal` (
  `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id',
  `entity_type_id` smallint(5) unsigned NOT NULL COMMENT 'Entity Type Id',
  `attribute_id` smallint(5) unsigned NOT NULL COMMENT 'Attribute Id',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store Id',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'Entity Id',
  `value` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Attribute Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `UNQ_EAV_ENTITY_DECIMAL_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `IDX_EAV_ENTITY_DECIMAL_ENTITY_TYPE_ID` (`entity_type_id`),
  KEY `IDX_EAV_ENTITY_DECIMAL_ATTRIBUTE_ID` (`attribute_id`),
  KEY `IDX_EAV_ENTITY_DECIMAL_STORE_ID` (`store_id`),
  KEY `IDX_EAV_ENTITY_DECIMAL_ENTITY_ID` (`entity_id`),
  KEY `IDX_EAV_ENTITY_DECIMAL_ATTRIBUTE_ID_VALUE` (`attribute_id`,`value`),
  KEY `IDX_EAV_ENTITY_DECIMAL_ENTITY_TYPE_ID_VALUE` (`entity_type_id`,`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Eav Entity Value Prefix';


CREATE TABLE `#__eav_entity_int` (
  `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id',
  `entity_type_id` smallint(5) unsigned NOT NULL COMMENT 'Entity Type Id',
  `attribute_id` smallint(5) unsigned NOT NULL COMMENT 'Attribute Id',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store Id',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'Entity Id',
  `value` int(11) NOT NULL COMMENT 'Attribute Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `UNQ_EAV_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `IDX_EAV_ENTITY_INT_ENTITY_TYPE_ID` (`entity_type_id`),
  KEY `IDX_EAV_ENTITY_INT_ATTRIBUTE_ID` (`attribute_id`),
  KEY `IDX_EAV_ENTITY_INT_STORE_ID` (`store_id`),
  KEY `IDX_EAV_ENTITY_INT_ENTITY_ID` (`entity_id`),
  KEY `IDX_EAV_ENTITY_INT_ATTRIBUTE_ID_VALUE` (`attribute_id`,`value`),
  KEY `IDX_EAV_ENTITY_INT_ENTITY_TYPE_ID_VALUE` (`entity_type_id`,`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Eav Entity Value Prefix';


CREATE TABLE `#__eav_entity_store` (
  `entity_store_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Store Id',
  `entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Entity Type Id',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Id',
  `increment_prefix` varchar(20) DEFAULT NULL COMMENT 'Increment Prefix',
  `increment_last_id` varchar(50) DEFAULT NULL COMMENT 'Last Incremented Id',
  PRIMARY KEY (`entity_store_id`),
  KEY `IDX_EAV_ENTITY_STORE_ENTITY_TYPE_ID` (`entity_type_id`),
  KEY `IDX_EAV_ENTITY_STORE_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Eav Entity Store';

INSERT INTO `#__eav_entity_store` (`entity_store_id`, `entity_type_id`, `store_id`, `increment_prefix`, `increment_last_id`) VALUES
(1, 4, 1, '1', '100000008');

CREATE TABLE `#__eav_entity_text` (
  `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id',
  `entity_type_id` smallint(5) unsigned NOT NULL COMMENT 'Entity Type Id',
  `attribute_id` smallint(5) unsigned NOT NULL COMMENT 'Attribute Id',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store Id',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'Entity Id',
  `value` text NOT NULL COMMENT 'Attribute Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `UNQ_EAV_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `IDX_EAV_ENTITY_TEXT_ENTITY_TYPE_ID` (`entity_type_id`),
  KEY `IDX_EAV_ENTITY_TEXT_ATTRIBUTE_ID` (`attribute_id`),
  KEY `IDX_EAV_ENTITY_TEXT_STORE_ID` (`store_id`),
  KEY `IDX_EAV_ENTITY_TEXT_ENTITY_ID` (`entity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Eav Entity Value Prefix';


CREATE TABLE `#__eav_entity_type` (
  `entity_type_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Type Id',
  `entity_type_code` varchar(50) NOT NULL COMMENT 'Entity Type Code',
  `entity_model` varchar(255) NOT NULL COMMENT 'Entity Model',
  `attribute_model` varchar(255) DEFAULT NULL COMMENT 'Attribute Model',
  `entity_table` varchar(255) DEFAULT NULL COMMENT 'Entity Table',
  `value_table_prefix` varchar(255) DEFAULT NULL COMMENT 'Value Table Prefix',
  `entity_id_field` varchar(255) DEFAULT NULL COMMENT 'Entity Id Field',
  `is_data_sharing` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'Defines Is Data Sharing',
  `data_sharing_key` varchar(100) DEFAULT 'default' COMMENT 'Data Sharing Key',
  `default_attribute_set_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Default Attribute Set Id',
  `increment_model` varchar(255) DEFAULT '' COMMENT 'Increment Model',
  `increment_per_store` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Increment Per Store',
  `increment_pad_length` smallint(5) unsigned NOT NULL DEFAULT '8' COMMENT 'Increment Pad Length',
  `increment_pad_char` varchar(1) NOT NULL DEFAULT '0' COMMENT 'Increment Pad Char',
  `additional_attribute_table` varchar(255) DEFAULT '' COMMENT 'Additional Attribute Table',
  `entity_attribute_collection` varchar(255) DEFAULT '' COMMENT 'Entity Attribute Collection',
  PRIMARY KEY (`entity_type_id`),
  KEY `IDX_EAV_ENTITY_TYPE_ENTITY_TYPE_CODE` (`entity_type_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Eav Entity Type';

INSERT INTO `#__eav_entity_type` (`entity_type_id`, `entity_type_code`, `entity_model`, `attribute_model`, `entity_table`, `value_table_prefix`, `entity_id_field`, `is_data_sharing`, `data_sharing_key`, `default_attribute_set_id`, `increment_model`, `increment_per_store`, `increment_pad_length`, `increment_pad_char`, `additional_attribute_table`, `entity_attribute_collection`) VALUES
(1, 'customer', 'customer/customer', 'customer/attribute', 'customer/entity', '', '', 1, 'default', 1, 'eav/entity_increment_numeric', 0, 8, '0', 'customer/eav_attribute', 'customer/attribute_collection'),
(2, 'customer_address', 'customer/address', 'customer/attribute', 'customer/address_entity', '', '', 1, 'default', 2, '', 0, 8, '0', 'customer/eav_attribute', 'customer/address_attribute_collection'),
(3, 'customer_payment', '', '', 'customer/entity', '', '', 1, 'default', 3, '', 0, 8, '0', '', ''),
(4, 'order', 'sales/order', '', 'sales/order', '', '', 1, 'default', 18, 'eav/entity_increment_numeric', 1, 8, '0', '', ''),
(5, 'order_status', '', '', 'sales/order', '', '', 1, 'default', 0, '', 0, 8, '0', '', ''),
(6, 'order_address', 'sales/order_address', '', 'sales/order_entity', '', '', 1, 'default', 20, '', 0, 8, '0', '', ''),
(7, 'order_item', 'sales/order_item', '', 'sales/order_entity', '', '', 1, 'default', 21, '', 0, 8, '0', '', ''),
(8, 'order_payment', 'sales/order_payment', '', 'sales/order_entity', '', '', 1, 'default', 22, '', 0, 8, '0', '', ''),
(9, 'catalog_category', 'catalog/category', 'catalog/resource_eav_attribute', 'catalog/category', '', '', 0, 'default', 12, '', 0, 8, '0', 'catalog/eav_attribute', 'catalog/category_attribute_collection'),
(10, 'catalog_product', 'catalog/product', 'catalog/resource_eav_attribute', 'catalog/product', '', '', 0, 'default', 9, '', 0, 8, '0', 'catalog/eav_attribute', 'catalog/product_attribute_collection'),
(11, 'quote', 'sales/quote', '', 'sales/quote', '', '', 1, 'default', 23, '', 0, 8, '0', '', ''),
(12, 'quote_address', 'sales/quote_address', '', 'sales/quote_address', '', '', 1, 'default', 24, '', 0, 8, '0', '', ''),
(13, 'quote_address_rate', 'sales/quote_address_rate', '', 'sales/quote_entity', '', '', 1, 'default', 25, '', 0, 8, '0', '', ''),
(14, 'quote_address_item', 'sales/quote_address_item', '', 'sales/quote_entity', '', '', 1, 'default', 26, '', 0, 8, '0', '', ''),
(15, 'quote_item', 'sales/quote_item', '', 'sales/quote_item', '', '', 1, 'default', 27, '', 0, 8, '0', '', ''),
(16, 'quote_payment', 'sales/quote_payment', '', 'sales/quote_entity', '', '', 1, 'default', 28, '', 0, 8, '0', '', ''),
(17, 'order_status_history', 'sales/order_status_history', '', 'sales/order_entity', '', '', 1, 'default', 29, '', 0, 8, '0', '', ''),
(18, 'invoice', 'sales/order_invoice', '', 'sales/order_entity', '', '', 1, 'default', 30, 'eav/entity_increment_numeric', 1, 8, '0', '', ''),
(20, 'invoice_item', 'sales/order_invoice_item', '', 'sales/order_entity', '', '', 1, 'default', 32, '', 0, 8, '0', '', ''),
(22, 'invoice_shipment', '', '', 'sales/invoice', '', '', 1, 'default', 34, '', 0, 8, '0', '', ''),
(23, 'invoice_comment', 'sales/order_invoice_comment', '', 'sales/order_entity', '', '', 1, 'default', 50, '', 0, 8, '0', '', ''),
(24, 'shipment', 'sales/order_shipment', '', 'sales/order_entity', '', '', 1, 'default', 51, 'eav/entity_increment_numeric', 1, 8, '0', '', ''),
(25, 'shipment_item', 'sales/order_shipment_item', '', 'sales/order_entity', '', '', 1, 'default', 52, '', 0, 8, '0', '', ''),
(26, 'shipment_comment', 'sales/order_shipment_comment', '', 'sales/order_entity', '', '', 1, 'default', 53, '', 0, 8, '0', '', ''),
(27, 'shipment_track', 'sales/order_shipment_track', '', 'sales/order_entity', '', '', 1, 'default', 54, '', 0, 8, '0', '', ''),
(28, 'creditmemo', 'sales/order_creditmemo', '', 'sales/order_entity', '', '', 1, 'default', 55, 'eav/entity_increment_numeric', 1, 8, '0', '', ''),
(29, 'creditmemo_item', 'sales/order_creditmemo_item', '', 'sales/order_entity', '', '', 1, 'default', 56, '', 0, 8, '0', '', ''),
(30, 'creditmemo_comment', 'sales/order_creditmemo_comment', '', 'sales/order_entity', '', '', 1, 'default', 57, '', 0, 8, '0', '', '');

CREATE TABLE `#__eav_entity_varchar` (
  `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id',
  `entity_type_id` smallint(5) unsigned NOT NULL COMMENT 'Entity Type Id',
  `attribute_id` smallint(5) unsigned NOT NULL COMMENT 'Attribute Id',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store Id',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'Entity Id',
  `value` varchar(255) NOT NULL COMMENT 'Attribute Value',
  PRIMARY KEY (`value_id`),
  UNIQUE KEY `UNQ_EAV_ENTITY_VARCHAR_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  KEY `IDX_EAV_ENTITY_VARCHAR_ENTITY_TYPE_ID` (`entity_type_id`),
  KEY `IDX_EAV_ENTITY_VARCHAR_ATTRIBUTE_ID` (`attribute_id`),
  KEY `IDX_EAV_ENTITY_VARCHAR_STORE_ID` (`store_id`),
  KEY `IDX_EAV_ENTITY_VARCHAR_ENTITY_ID` (`entity_id`),
  KEY `IDX_EAV_ENTITY_VARCHAR_ATTRIBUTE_ID_VALUE` (`attribute_id`,`value`),
  KEY `IDX_EAV_ENTITY_VARCHAR_ENTITY_TYPE_ID_VALUE` (`entity_type_id`,`value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Eav Entity Value Prefix';


CREATE TABLE `#__eav_form_element` (
  `element_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Element Id',
  `type_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Type Id',
  `fieldset_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Fieldset Id',
  `attribute_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute Id',
  `sort_order` int(11) NOT NULL DEFAULT '0' COMMENT 'Sort Order',
  PRIMARY KEY (`element_id`),
  UNIQUE KEY `UNQ_EAV_FORM_ELEMENT_TYPE_ID_ATTRIBUTE_ID` (`type_id`,`attribute_id`),
  KEY `IDX_EAV_FORM_ELEMENT_TYPE_ID` (`type_id`),
  KEY `IDX_EAV_FORM_ELEMENT_FIELDSET_ID` (`fieldset_id`),
  KEY `IDX_EAV_FORM_ELEMENT_ATTRIBUTE_ID` (`attribute_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Eav Form Element';

INSERT INTO `#__eav_form_element` (`element_id`, `type_id`, `fieldset_id`, `attribute_id`, `sort_order`) VALUES
(1, 1, 1, 1, 0),
(2, 1, 1, 2, 1),
(3, 1, 1, 3, 2),
(4, 2, 2, 1, 0),
(5, 2, 2, 2, 1),
(6, 2, 2, 3, 2),
(7, 3, 3, 9, 0),
(8, 3, 3, 10, 1),
(9, 3, 3, 95, 2),
(10, 3, 3, 17, 3),
(11, 3, 3, 18, 4),
(12, 3, 4, 16, 0),
(13, 3, 4, 15, 1),
(14, 3, 4, 12, 2),
(15, 3, 4, 14, 3),
(16, 3, 4, 11, 4),
(17, 4, NULL, 9, 0),
(18, 4, NULL, 10, 1),
(19, 4, NULL, 95, 2),
(20, 4, NULL, 3, 3),
(21, 4, NULL, 16, 4),
(22, 4, NULL, 15, 5),
(23, 4, NULL, 12, 6),
(24, 4, NULL, 14, 7),
(25, 4, NULL, 11, 8),
(26, 4, NULL, 17, 9),
(27, 4, NULL, 18, 10),
(28, 5, NULL, 9, 0),
(29, 5, NULL, 10, 1),
(30, 5, NULL, 95, 2),
(31, 5, NULL, 3, 3),
(32, 5, NULL, 16, 4),
(33, 5, NULL, 15, 5),
(34, 5, NULL, 12, 6),
(35, 5, NULL, 14, 7),
(36, 5, NULL, 11, 8),
(37, 5, NULL, 17, 9),
(38, 5, NULL, 18, 10),
(39, 6, NULL, 9, 0),
(40, 6, NULL, 10, 1),
(41, 6, NULL, 95, 2),
(42, 6, NULL, 16, 3),
(43, 6, NULL, 15, 4),
(44, 6, NULL, 12, 5),
(45, 6, NULL, 14, 6),
(46, 6, NULL, 11, 7),
(47, 6, NULL, 17, 8),
(48, 6, NULL, 18, 9),
(49, 7, NULL, 9, 0),
(50, 7, NULL, 10, 1),
(51, 7, NULL, 95, 2),
(52, 7, NULL, 16, 3),
(53, 7, NULL, 15, 4),
(54, 7, NULL, 12, 5),
(55, 7, NULL, 14, 6),
(56, 7, NULL, 11, 7),
(57, 7, NULL, 17, 8),
(58, 7, NULL, 18, 9),
(59, 8, 5, 1, 0),
(60, 8, 5, 2, 1),
(61, 8, 5, 3, 2),
(62, 8, 6, 95, 0),
(63, 8, 6, 17, 1),
(64, 8, 6, 16, 2),
(65, 8, 6, 15, 3),
(66, 8, 6, 12, 4),
(67, 8, 6, 14, 5),
(68, 8, 6, 11, 6);

CREATE TABLE `#__eav_form_fieldset` (
  `fieldset_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Fieldset Id',
  `type_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Type Id',
  `code` varchar(64) NOT NULL COMMENT 'Code',
  `sort_order` int(11) NOT NULL DEFAULT '0' COMMENT 'Sort Order',
  PRIMARY KEY (`fieldset_id`),
  UNIQUE KEY `UNQ_EAV_FORM_FIELDSET_TYPE_ID_CODE` (`type_id`,`code`),
  KEY `IDX_EAV_FORM_FIELDSET_TYPE_ID` (`type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Eav Form Fieldset';

INSERT INTO `#__eav_form_fieldset` (`fieldset_id`, `type_id`, `code`, `sort_order`) VALUES
(1, 1, 'general', 1),
(2, 2, 'general', 1),
(3, 3, 'contact', 1),
(4, 3, 'address', 2),
(5, 8, 'general', 1),
(6, 8, 'address', 2);

CREATE TABLE `#__eav_form_fieldset_label` (
  `fieldset_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Fieldset Id',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Id',
  `label` varchar(255) NOT NULL COMMENT 'Label',
  PRIMARY KEY (`fieldset_id`,`store_id`),
  KEY `IDX_EAV_FORM_FIELDSET_LABEL_FIELDSET_ID` (`fieldset_id`),
  KEY `IDX_EAV_FORM_FIELDSET_LABEL_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Eav Form Fieldset Label';

INSERT INTO `#__eav_form_fieldset_label` (`fieldset_id`, `store_id`, `label`) VALUES
(1, 0, 'Personal Information'),
(2, 0, 'Account Information'),
(3, 0, 'Contact Information'),
(4, 0, 'Address'),
(5, 0, 'Personal Information'),
(6, 0, 'Address Information');

CREATE TABLE `#__eav_form_type` (
  `type_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Type Id',
  `code` varchar(64) NOT NULL COMMENT 'Code',
  `label` varchar(255) NOT NULL COMMENT 'Label',
  `is_system` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Is System',
  `theme` varchar(64) DEFAULT NULL COMMENT 'Theme',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Id',
  PRIMARY KEY (`type_id`),
  UNIQUE KEY `UNQ_EAV_FORM_TYPE_CODE_THEME_STORE_ID` (`code`,`theme`,`store_id`),
  KEY `IDX_EAV_FORM_TYPE_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Eav Form Type';

INSERT INTO `#__eav_form_type` (`type_id`, `code`, `label`, `is_system`, `theme`, `store_id`) VALUES
(1, 'customer_account_create', 'customer_account_create', 1, '', 0),
(2, 'customer_account_edit', 'customer_account_edit', 1, '', 0),
(3, 'customer_address_edit', 'customer_address_edit', 1, '', 0),
(4, 'checkout_onepage_register', 'checkout_onepage_register', 1, '', 0),
(5, 'checkout_onepage_register_guest', 'checkout_onepage_register_guest', 1, '', 0),
(6, 'checkout_onepage_billing_address', 'checkout_onepage_billing_address', 1, '', 0),
(7, 'checkout_onepage_shipping_address', 'checkout_onepage_shipping_address', 1, '', 0),
(8, 'checkout_multishipping_register', 'checkout_multishipping_register', 1, '', 0);

CREATE TABLE `#__eav_form_type_entity` (
  `type_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Type Id',
  `entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Entity Type Id',
  PRIMARY KEY (`type_id`,`entity_type_id`),
  KEY `IDX_EAV_FORM_TYPE_ENTITY_ENTITY_TYPE_ID` (`entity_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Eav Form Type Entity';

INSERT INTO `#__eav_form_type_entity` (`type_id`, `entity_type_id`) VALUES
(1, 1),
(2, 1),
(3, 2),
(4, 1),
(4, 2),
(5, 1),
(5, 2),
(6, 2),
(7, 2),
(8, 1),
(8, 2);

CREATE TABLE `#__eway_api_debug` (
  `debug_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `debug_at` timestamp NOT NULL,
  `request_body` text,
  `response_body` text,
  PRIMARY KEY (`debug_id`),
  KEY `debug_at` (`debug_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `#__find_feed_import_codes` (
  `code_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `import_code` varchar(255) NOT NULL,
  `eav_code` varchar(255) NOT NULL,
  `is_imported` int(10) unsigned NOT NULL,
  PRIMARY KEY (`code_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `#__flo2cash_api_debug` (
  `debug_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `debug_at` timestamp NOT NULL,
  `request_body` text,
  `response_body` text,
  `exception` text,
  PRIMARY KEY (`debug_id`),
  KEY `debug_at` (`debug_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `#__gift_message` (
  `gift_message_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'GiftMessage Id',
  `customer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer id',
  `sender` varchar(255) DEFAULT NULL COMMENT 'Sender',
  `recipient` varchar(255) DEFAULT NULL COMMENT 'Recipient',
  `message` text COMMENT 'Message',
  PRIMARY KEY (`gift_message_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Gift Message';


CREATE TABLE `#__googlebase_attributes` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `attribute_id` smallint(5) unsigned NOT NULL COMMENT 'Attribute id',
  `gbase_attribute` varchar(255) DEFAULT NULL COMMENT 'Google base attribute',
  `type_id` int(10) unsigned NOT NULL COMMENT 'Type id',
  PRIMARY KEY (`id`),
  KEY `IDX_GOOGLEBASE_ATTRIBUTES_ATTRIBUTE_ID` (`attribute_id`),
  KEY `IDX_GOOGLEBASE_ATTRIBUTES_TYPE_ID` (`type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Google Base Attributes link Product Attributes';


CREATE TABLE `#__googlebase_items` (
  `item_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Item id',
  `type_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Type id',
  `product_id` int(10) unsigned NOT NULL COMMENT 'Product id',
  `gbase_item_id` varchar(255) NOT NULL COMMENT 'Google base item id',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store Id',
  `published` timestamp NOT NULL COMMENT 'Published',
  `expires` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Expires',
  `impr` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Google impressions',
  `clicks` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Google clicks',
  `views` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Google views',
  `is_hidden` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Hidden flag',
  PRIMARY KEY (`item_id`),
  KEY `IDX_GOOGLEBASE_ITEMS_PRODUCT_ID` (`product_id`),
  KEY `IDX_GOOGLEBASE_ITEMS_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Google Base Items Products';


CREATE TABLE `#__googlebase_types` (
  `type_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Type id',
  `attribute_set_id` smallint(5) unsigned NOT NULL COMMENT 'Attribute set id',
  `gbase_itemtype` varchar(255) NOT NULL COMMENT 'Google base item type',
  `target_country` varchar(2) NOT NULL DEFAULT 'US' COMMENT 'Target country',
  PRIMARY KEY (`type_id`),
  KEY `IDX_GOOGLEBASE_TYPES_ATTRIBUTE_SET_ID` (`attribute_set_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Google Base Item Types link Attribute Sets';


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;


CREATE TABLE `#__googlecheckout_notification` (
  `serial_number` varchar(64) NOT NULL COMMENT 'Serial Number',
  `started_at` timestamp NULL DEFAULT NULL COMMENT 'Started At',
  `status` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Status',
  PRIMARY KEY (`serial_number`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Google Checkout Notification Table';


CREATE TABLE `#__googleoptimizer_code` (
  `code_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Google optimizer code id',
  `entity_id` int(10) unsigned NOT NULL COMMENT 'Optimized entity id product id or catalog id',
  `entity_type` varchar(50) DEFAULT NULL COMMENT 'Optimized entity type',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store id',
  `control_script` text COMMENT 'Google optimizer control script',
  `tracking_script` text COMMENT 'Google optimizer tracking script',
  `conversion_script` text COMMENT 'Google optimizer conversion script',
  `conversion_page` varchar(255) DEFAULT NULL COMMENT 'Google optimizer conversion page',
  `additional_data` text COMMENT 'Google optimizer additional data',
  PRIMARY KEY (`code_id`),
  KEY `IDX_GOOGLEOPTIMIZER_CODE_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Googleoptimizer code';


CREATE TABLE `#__ideal_api_debug` (
  `debug_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `debug_at` timestamp NOT NULL,
  `request_body` text,
  `response_body` text,
  PRIMARY KEY (`debug_id`),
  KEY `debug_at` (`debug_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `#__importexport_importdata` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `entity` varchar(50) NOT NULL,
  `behavior` set('append','replace','delete') NOT NULL DEFAULT 'append',
  `data` longtext COMMENT 'Data',
  PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE `#__index_event` (
  `event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Event Id',
  `type` varchar(64) NOT NULL COMMENT 'Type',
  `entity` varchar(64) NOT NULL COMMENT 'Entity',
  `entity_pk` bigint(20) DEFAULT NULL COMMENT 'Entity Primary Key',
  `created_at` timestamp NOT NULL COMMENT 'Creation Time',
  `old_data` mediumtext COMMENT 'Old Data',
  `new_data` mediumtext COMMENT 'New Data',
  PRIMARY KEY (`event_id`),
  UNIQUE KEY `UNQ_INDEX_EVENT_TYPE_ENTITY_ENTITY_PK` (`type`,`entity`,`entity_pk`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Index Event';

CREATE TABLE `#__index_process` (
  `process_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Process Id',
  `indexer_code` varchar(32) NOT NULL COMMENT 'Indexer Code',
  `status` varchar(15) NOT NULL DEFAULT 'pending' COMMENT 'Status',
  `started_at` timestamp NULL DEFAULT NULL COMMENT 'Started At',
  `ended_at` timestamp NULL DEFAULT NULL COMMENT 'Ended At',
  `mode` varchar(9) NOT NULL DEFAULT 'real_time' COMMENT 'Mode',
  PRIMARY KEY (`process_id`),
  UNIQUE KEY `UNQ_INDEX_PROCESS_INDEXER_CODE` (`indexer_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Index Process';

CREATE TABLE `#__index_process_event` (
  `process_id` int(10) unsigned NOT NULL COMMENT 'Process Id',
  `event_id` bigint(20) unsigned NOT NULL COMMENT 'Event Id',
  `status` varchar(7) NOT NULL DEFAULT 'new' COMMENT 'Status',
  PRIMARY KEY (`process_id`,`event_id`),
  KEY `IDX_INDEX_PROCESS_EVENT_EVENT_ID` (`event_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Index Process Event';

CREATE TABLE `#__jmmegamenu` (
  `menu_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) NOT NULL DEFAULT '',
  `link` text,
  `url` varchar(255) DEFAULT NULL,
  `catid` int(11) DEFAULT NULL,
  `menualias` varchar(255) DEFAULT NULL,
  `menutype` varchar(50) NOT NULL DEFAULT '',
  `category` varchar(255) DEFAULT NULL,
  `cms` varchar(255) DEFAULT NULL,
  `parent` int(11) unsigned NOT NULL DEFAULT '0',
  `lft` int(11) unsigned NOT NULL DEFAULT '0',
  `rgt` int(11) unsigned NOT NULL DEFAULT '0',
  `mega_cols` int(11) unsigned NOT NULL DEFAULT '0',
  `mega_group` smallint(6) NOT NULL DEFAULT '0',
  `mega_class` varchar(255) NOT NULL DEFAULT '',
  `status` smallint(6) NOT NULL DEFAULT '0',
  `ordering` int(11) DEFAULT '0',
  `showtitle` tinyint(6) NOT NULL DEFAULT '1',
  `menugroup` int(11) unsigned NOT NULL,
  `created_time` datetime DEFAULT NULL,
  `update_time` datetime DEFAULT NULL,
  `static_block` varchar(255) DEFAULT NULL,
  `mega_subcontent` int(11) NOT NULL DEFAULT '1',
  `mega_width` int(11) DEFAULT NULL,
  `mega_colw` int(11) DEFAULT NULL,
  `mega_colxw` varchar(255) DEFAULT NULL,
  `desc` text,
  `browserNav` tinyint(4) NOT NULL DEFAULT '0',
  `contentxml` text,
  `image` varchar(255) DEFAULT '',
  `description` text,
  `shownumproduct` smallint(6) DEFAULT '0',
  PRIMARY KEY (`menu_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;

INSERT INTO `#__jmmegamenu` (`menu_id`, `title`, `link`, `url`, `catid`, `menualias`, `menutype`, `category`, `cms`, `parent`, `lft`, `rgt`, `mega_cols`, `mega_group`, `mega_class`, `status`, `ordering`, `showtitle`, `menugroup`, `created_time`, `update_time`, `static_block`, `mega_subcontent`, `mega_width`, `mega_colw`, `mega_colxw`, `desc`, `browserNav`, `contentxml`, `image`, `description`, `shownumproduct`) VALUES
(1, 'Home', 'http://10.0.0.134/jm_trex/index.php/home', 'home', 0, NULL, '1', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'http://10.0.0.134/jm_trex/index.php/home', 0, 0, 0, 1, 0, '', 1, 1, 1, 12, '2013-06-06 08:04:08', '2013-06-06 08:04:08', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(2, 'Bikes', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'bikes.html', 37, NULL, '0', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'http://10.0.0.134/jm_trex/index.php/home', 0, 0, 0, 3, 0, '', 1, 2, 1, 12, '2013-06-06 08:04:40', '2013-06-07 09:59:01', NULL, 1, 618, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(3, 'Gears', 'http://10.0.0.134/jm_trex/index.php/gears.html', 'gears.html', 42, NULL, '0', 'http://10.0.0.134/jm_trex/index.php/gears.html', 'http://10.0.0.134/jm_trex/index.php/home', 0, 0, 0, 1, 0, '', 1, 3, 1, 12, '2013-06-06 08:05:02', '2013-06-06 08:05:02', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(4, 'Retailers', 'http://10.0.0.134/jm_trex/index.php/retailers.html', 'retailers.html', 39, NULL, '0', 'http://10.0.0.134/jm_trex/index.php/retailers.html', 'http://10.0.0.134/jm_trex/index.php/home', 0, 0, 0, 1, 0, '', 1, 4, 1, 12, '2013-06-06 08:05:34', '2013-06-06 08:05:34', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(5, 'Company', 'http://10.0.0.134/jm_trex/index.php/company.html', 'company.html', 40, NULL, '0', 'http://10.0.0.134/jm_trex/index.php/company.html', 'http://10.0.0.134/jm_trex/index.php/home', 0, 0, 0, 1, 0, '', 1, 5, 1, 12, '2013-06-06 08:05:55', '2013-06-06 08:05:55', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(6, 'Colors', '#', 'bikes.html', 37, NULL, '2', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/bikes.html', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/home', 0, 0, 0, 1, 0, 'listcolor', 1, 6, 1, 12, '2013-06-06 08:06:27', '2013-06-11 04:58:34', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(7, 'Category', '#', NULL, 0, NULL, '2', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'http://10.0.0.134/jm_trex/index.php/home', 2, 0, 0, 1, 1, '', 1, 1, 0, 12, '2013-06-06 08:27:36', '2013-06-07 09:38:23', NULL, 1, 190, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(8, 'Featured Product', '#', NULL, 0, NULL, '2', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'http://10.0.0.134/jm_trex/index.php/home', 2, 0, 0, 1, 1, '', 1, 2, 0, 12, '2013-06-06 08:27:59', '2013-06-07 10:02:09', '20', 3, 409, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(9, 'Beistegui Hermanos', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'bikes.html', 37, NULL, '0', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'http://10.0.0.134/jm_trex/index.php/home', 7, 0, 0, 1, 1, '', 1, 1, 1, 12, '2013-06-06 08:30:46', '2013-06-07 09:27:51', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(10, 'Bradbury', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'bikes.html', 37, NULL, '0', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'http://10.0.0.134/jm_trex/index.php/home', 7, 0, 0, 1, 1, '', 1, 2, 1, 12, '2013-06-07 01:47:11', '2013-06-07 09:28:06', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(11, 'Cannondale', 'http://10.0.0.134/jm_trex/index.php/bikes/youth.html', 'bikes/youth.html', 52, NULL, '0', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'http://10.0.0.134/jm_trex/index.php/home', 7, 0, 0, 1, 1, '', 1, 3, 1, 12, '2013-06-07 01:48:15', '2013-06-07 09:28:21', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(12, 'Cycles Devinci', 'http://10.0.0.134/jm_trex/index.php/bikes/on-road.html', 'bikes/on-road.html', 53, NULL, '0', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'http://10.0.0.134/jm_trex/index.php/home', 7, 0, 0, 1, 1, '', 1, 4, 1, 12, '2013-06-07 01:48:48', '2013-06-07 09:28:43', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(13, 'Claud Butler', 'http://10.0.0.134/jm_trex/index.php/bikes/x-road.html', 'bikes/x-road.html', 54, NULL, '0', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'http://10.0.0.134/jm_trex/index.php/home', 7, 0, 0, 1, 1, '', 1, 5, 1, 12, '2013-06-07 01:49:49', '2013-06-07 09:28:59', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(14, 'Ellis Briggs', 'http://10.0.0.134/jm_trex/index.php/bikes/bmx.html', 'bikes/bmx.html', 55, NULL, '0', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'http://10.0.0.134/jm_trex/index.php/home', 7, 0, 0, 1, 1, '', 1, 6, 1, 12, '2013-06-07 01:50:10', '2013-06-07 09:29:16', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(15, 'Cycles Follis', 'http://10.0.0.134/jm_trex/index.php/bikes/off-road.html', 'bikes/off-road.html', 56, NULL, '0', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'http://10.0.0.134/jm_trex/index.php/home', 7, 0, 0, 1, 1, '', 1, 7, 1, 12, '2013-06-07 01:50:47', '2013-06-07 09:30:00', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(16, 'Cycles Follis', 'http://10.0.0.134/jm_trex/index.php/company/continental.html', 'company/continental.html', 61, NULL, '0', 'http://10.0.0.134/jm_trex/index.php/company/continental.html', 'http://10.0.0.134/jm_trex/index.php/home', 7, 0, 0, 1, 1, '', 1, 8, 1, 12, '2013-06-07 09:30:24', '2013-06-07 09:30:24', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(17, 'Hotsale', '#', NULL, 0, NULL, '2', 'http://10.0.0.134/jm_trex/index.php/bikes.html', 'http://10.0.0.134/jm_trex/index.php/home', 2, 0, 0, 1, 1, '', 1, 3, 0, 12, '2013-06-07 09:51:18', '2013-06-07 09:53:27', NULL, 2, 568, 0, NULL, NULL, 0, '<a title="Hot summer sale" href="#"><img src="{{media url="wysiwyg/banner_sale.jpg"}}" alt="Hot summer sale" /></a>', '', NULL, 0),
(18, 'List color', '#', 'bikes.html', 37, NULL, '2', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/bikes.html', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/home', 6, 0, 0, 1, 1, '', 1, 1, 0, 12, '2013-06-07 10:09:15', '2013-06-11 04:58:00', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(19, 'Default Color', '#', NULL, 0, NULL, '2', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/bikes.html', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/home', 18, 0, 0, 1, 1, 'default', 1, 1, 1, 12, '2013-06-07 10:10:12', '2013-06-11 09:48:12', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(20, 'Blue Color', '#', NULL, 0, NULL, '2', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/bikes.html', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/home', 18, 0, 0, 1, 1, 'blue', 1, 2, 1, 12, '2013-06-07 10:11:00', '2013-06-11 09:50:47', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(21, 'Green Color', '#', NULL, 0, NULL, '2', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/bikes.html', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/home', 18, 0, 0, 1, 1, 'green', 1, 3, 1, 12, '2013-06-07 10:11:21', '2013-06-11 09:51:12', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(22, 'Violet Color', '#', NULL, 0, NULL, '2', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/bikes.html', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/home', 18, 0, 0, 1, 1, 'violet', 1, 4, 1, 12, '2013-06-07 10:12:13', '2013-06-11 09:51:29', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0),
(23, 'Yellow Color', '#', NULL, 0, NULL, '2', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/bikes.html', 'http://dev.joomlart.com/jadev2_data/sites/auto/qs.jmtctrex.1370924659/index.php/home', 18, 0, 0, 1, 1, 'yellow', 1, 5, 1, 12, '2013-06-07 10:12:32', '2013-06-11 09:51:52', NULL, 1, 0, 0, NULL, NULL, 0, NULL, '', NULL, 0);

CREATE TABLE `#__jmmegamenu_types` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `menutype` varchar(75) NOT NULL DEFAULT '',
  `title` varchar(255) NOT NULL DEFAULT '',
  `description` varchar(255) NOT NULL DEFAULT '',
  `storeid` int(10) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `menutype` (`menutype`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ;

INSERT INTO `#__jmmegamenu_types` (`id`, `menutype`, `title`, `description`, `storeid`) VALUES
(12, 'english', 'English', '', 1);

CREATE TABLE `#__log_customer` (
  `log_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Log ID',
  `visitor_id` bigint(20) unsigned DEFAULT NULL COMMENT 'Visitor ID',
  `customer_id` int(11) NOT NULL DEFAULT '0' COMMENT 'Customer ID',
  `login_at` timestamp NOT NULL COMMENT 'Login Time',
  `logout_at` timestamp NULL DEFAULT NULL COMMENT 'Logout Time',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store ID',
  PRIMARY KEY (`log_id`),
  KEY `IDX_LOG_CUSTOMER_VISITOR_ID` (`visitor_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Log Customers Table';

CREATE TABLE `#__log_quote` (
  `quote_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Quote ID',
  `visitor_id` bigint(20) unsigned DEFAULT NULL COMMENT 'Visitor ID',
  `created_at` timestamp NOT NULL COMMENT 'Creation Time',
  `deleted_at` timestamp NULL DEFAULT NULL COMMENT 'Deletion Time',
  PRIMARY KEY (`quote_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Log Quotes Table';

CREATE TABLE `#__log_summary` (
  `summary_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Summary ID',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store ID',
  `type_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Type ID',
  `visitor_count` int(11) NOT NULL DEFAULT '0' COMMENT 'Visitor Count',
  `customer_count` int(11) NOT NULL DEFAULT '0' COMMENT 'Customer Count',
  `add_date` timestamp NOT NULL COMMENT 'Date',
  PRIMARY KEY (`summary_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Log Summary Table';

CREATE TABLE `#__log_summary_type` (
  `type_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Type ID',
  `type_code` varchar(64) NOT NULL COMMENT 'Type Code',
  `period` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Period',
  `period_type` varchar(6) NOT NULL DEFAULT 'MINUTE' COMMENT 'Period Type',
  PRIMARY KEY (`type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Log Summary Types Table';

CREATE TABLE `#__log_url` (
  `url_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'URL ID',
  `visitor_id` bigint(20) unsigned DEFAULT NULL COMMENT 'Visitor ID',
  `visit_time` timestamp NOT NULL COMMENT 'Visit Time',
  KEY `IDX_LOG_URL_VISITOR_ID` (`visitor_id`),
  KEY `url_id` (`url_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Log URL Table';

CREATE TABLE `#__log_url_info` (
  `url_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'URL ID',
  `url` varchar(255) NOT NULL DEFAULT '' COMMENT 'URL',
  `referer` varchar(255) DEFAULT NULL COMMENT 'Referrer',
  PRIMARY KEY (`url_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Log URL Info Table';

CREATE TABLE `#__log_visitor` (
  `visitor_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Visitor ID',
  `session_id` varchar(64) NOT NULL COMMENT 'Session ID',
  `first_visit_at` timestamp NULL DEFAULT NULL COMMENT 'First Visit Time',
  `last_visit_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Last Visit Time',
  `last_url_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Last URL ID',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store ID',
  PRIMARY KEY (`visitor_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Log Visitors Table';

CREATE TABLE `#__log_visitor_info` (
  `visitor_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Visitor ID',
  `http_referer` varchar(255) DEFAULT NULL COMMENT 'HTTP Referrer',
  `http_user_agent` varchar(255) DEFAULT NULL COMMENT 'HTTP User-Agent',
  `http_accept_charset` varchar(255) DEFAULT NULL COMMENT 'HTTP Accept-Charset',
  `http_accept_language` varchar(255) DEFAULT NULL COMMENT 'HTTP Accept-Language',
  `server_addr` varbinary(16) DEFAULT NULL,
  `remote_addr` varbinary(16) DEFAULT NULL,
  PRIMARY KEY (`visitor_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Log Visitor Info Table';

CREATE TABLE `#__log_visitor_online` (
  `visitor_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Visitor ID',
  `visitor_type` varchar(1) NOT NULL COMMENT 'Visitor Type',
  `remote_addr` varbinary(16) DEFAULT NULL,
  `first_visit_at` timestamp NULL DEFAULT NULL COMMENT 'First Visit Time',
  `last_visit_at` timestamp NULL DEFAULT NULL COMMENT 'Last Visit Time',
  `customer_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer ID',
  `last_url` varchar(255) DEFAULT NULL COMMENT 'Last URL',
  PRIMARY KEY (`visitor_id`),
  KEY `IDX_LOG_VISITOR_ONLINE_VISITOR_TYPE` (`visitor_type`),
  KEY `IDX_LOG_VISITOR_ONLINE_FIRST_VISIT_AT_LAST_VISIT_AT` (`first_visit_at`,`last_visit_at`),
  KEY `IDX_LOG_VISITOR_ONLINE_CUSTOMER_ID` (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Log Visitor Online Table';

CREATE TABLE `#__newsletter_problem` (
  `problem_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Problem Id',
  `subscriber_id` int(10) unsigned DEFAULT NULL COMMENT 'Subscriber Id',
  `queue_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Queue Id',
  `problem_error_code` int(10) unsigned DEFAULT '0' COMMENT 'Problem Error Code',
  `problem_error_text` varchar(200) DEFAULT NULL COMMENT 'Problem Error Text',
  PRIMARY KEY (`problem_id`),
  KEY `IDX_NEWSLETTER_PROBLEM_SUBSCRIBER_ID` (`subscriber_id`),
  KEY `IDX_NEWSLETTER_PROBLEM_QUEUE_ID` (`queue_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter Problems';


CREATE TABLE `#__newsletter_queue` (
  `queue_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Queue Id',
  `template_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Template Id',
  `newsletter_type` int(11) DEFAULT NULL COMMENT 'Newsletter Type',
  `newsletter_text` text COMMENT 'Newsletter Text',
  `newsletter_styles` text COMMENT 'Newsletter Styles',
  `newsletter_subject` varchar(200) DEFAULT NULL COMMENT 'Newsletter Subject',
  `newsletter_sender_name` varchar(200) DEFAULT NULL COMMENT 'Newsletter Sender Name',
  `newsletter_sender_email` varchar(200) DEFAULT NULL COMMENT 'Newsletter Sender Email',
  `queue_status` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Queue Status',
  `queue_start_at` timestamp NULL DEFAULT NULL COMMENT 'Queue Start At',
  `queue_finish_at` timestamp NULL DEFAULT NULL COMMENT 'Queue Finish At',
  PRIMARY KEY (`queue_id`),
  KEY `IDX_NEWSLETTER_QUEUE_TEMPLATE_ID` (`template_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter Queue';


CREATE TABLE `#__newsletter_queue_link` (
  `queue_link_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Queue Link Id',
  `queue_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Queue Id',
  `subscriber_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Subscriber Id',
  `letter_sent_at` timestamp NULL DEFAULT NULL COMMENT 'Letter Sent At',
  PRIMARY KEY (`queue_link_id`),
  KEY `IDX_NEWSLETTER_QUEUE_LINK_SUBSCRIBER_ID` (`subscriber_id`),
  KEY `IDX_NEWSLETTER_QUEUE_LINK_QUEUE_ID` (`queue_id`),
  KEY `IDX_NEWSLETTER_QUEUE_LINK_QUEUE_ID_LETTER_SENT_AT` (`queue_id`,`letter_sent_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter Queue Link';


CREATE TABLE `#__newsletter_queue_store_link` (
  `queue_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Queue Id',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Id',
  PRIMARY KEY (`queue_id`,`store_id`),
  KEY `IDX_NEWSLETTER_QUEUE_STORE_LINK_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter Queue Store Link';


CREATE TABLE `#__newsletter_subscriber` (
  `subscriber_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Subscriber Id',
  `store_id` smallint(5) unsigned DEFAULT '0' COMMENT 'Store Id',
  `change_status_at` timestamp NULL DEFAULT NULL COMMENT 'Change Status At',
  `customer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Id',
  `subscriber_email` varchar(150) NOT NULL COMMENT 'Subscriber Email',
  `subscriber_status` int(11) NOT NULL DEFAULT '0' COMMENT 'Subscriber Status',
  `subscriber_confirm_code` varchar(32) DEFAULT 'NULL' COMMENT 'Subscriber Confirm Code',
  PRIMARY KEY (`subscriber_id`),
  KEY `IDX_NEWSLETTER_SUBSCRIBER_CUSTOMER_ID` (`customer_id`),
  KEY `IDX_NEWSLETTER_SUBSCRIBER_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter Subscriber';


CREATE TABLE `#__newsletter_template` (
  `template_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Template Id',
  `template_code` varchar(150) DEFAULT NULL COMMENT 'Template Code',
  `template_text` text COMMENT 'Template Text',
  `template_text_preprocessed` text COMMENT 'Template Text Preprocessed',
  `template_styles` text COMMENT 'Template Styles',
  `template_type` int(10) unsigned DEFAULT NULL COMMENT 'Template Type',
  `template_subject` varchar(200) DEFAULT NULL COMMENT 'Template Subject',
  `template_sender_name` varchar(200) DEFAULT NULL COMMENT 'Template Sender Name',
  `template_sender_email` varchar(200) DEFAULT NULL COMMENT 'Template Sender Email',
  `template_actual` smallint(5) unsigned DEFAULT '1' COMMENT 'Template Actual',
  `added_at` timestamp NULL DEFAULT NULL COMMENT 'Added At',
  `modified_at` timestamp NULL DEFAULT NULL COMMENT 'Modified At',
  PRIMARY KEY (`template_id`),
  KEY `IDX_NEWSLETTER_TEMPLATE_TEMPLATE_ACTUAL` (`template_actual`),
  KEY `IDX_NEWSLETTER_TEMPLATE_ADDED_AT` (`added_at`),
  KEY `IDX_NEWSLETTER_TEMPLATE_MODIFIED_AT` (`modified_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Newsletter Template';

INSERT INTO `#__newsletter_template` (`template_id`, `template_code`, `template_text`, `template_text_preprocessed`, `template_styles`, `template_type`, `template_subject`, `template_sender_name`, `template_sender_email`, `template_actual`, `added_at`, `modified_at`) VALUES
(1, 'Example Newsletter Template', '{{template config_path="design/email/header"}}\n{{inlinecss file="email-inline.css"}}\n\n<table cellpadding="0" cellspacing="0" border="0">\n<tr>\n    <td class="full">\n        <table class="columns">\n            <tr>\n                <td class="email-heading">\n                    <h1>Welcome</h1>\n                    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit,\n                    sed do eiusmod tempor incididunt ut labore et.</p>\n                </td>\n                <td class="store-info">\n                    <h4>Contact Us</h4>\n                    <p>\n                        {{depend store_phone}}\n                        <b>Call Us:</b>\n                        <a href="tel:{{var phone}}">{{var store_phone}}</a><br>\n                        {{/depend}}\n                        {{depend store_hours}}\n                        <span class="no-link">{{var store_hours}}</span><br>\n                        {{/depend}}\n                        {{depend store_email}}\n                        <b>Email:</b> <a href="mailto:{{var store_email}}">{{var store_email}}</a>\n                        {{/depend}}\n                    </p>\n                </td>\n            </tr>\n        </table>\n    </td>\n</tr>\n<tr>\n    <td class="full">\n        <table class="columns">\n            <tr>\n                <td>\n                    <img width="600" src="http://placehold.it/600x200" class="main-image">\n                </td>\n                <td class="expander"></td>\n            </tr>\n        </table>\n        <table class="columns">\n            <tr>\n                <td class="panel">\n                    <p>Phasellus dictum sapien a neque luctus cursus. Pellentesque sem dolor, fringilla et pharetra\n                    vitae. <a href="#">Click it! &raquo;</a></p>\n                </td>\n                <td class="expander"></td>\n            </tr>\n        </table>\n    </td>\n</tr>\n<tr>\n    <td>\n        <table class="row">\n            <tr>\n                <td class="half left wrapper">\n                    <table class="columns">\n                        <tr>\n                            <td>\n                                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor\n                                incididunt ut labore et. Lorem ipsum dolor sit amet, consectetur adipisicing elit,\n                                sed do eiusmod tempor incididunt ut labore et. Lorem ipsum dolor sit amet.</p>\n                                <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor\n                                incididunt ut labore et. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed\n                                do eiusmod tempor incididunt ut labore et. Lorem ipsum dolor sit amet.</p>\n                                <table class="button">\n                                    <tr>\n                                        <td>\n                                            <a href="#">Click Me!</a>\n                                        </td>\n                                    </tr>\n                                </table>\n                            </td>\n                            <td class="expander"></td>\n                        </tr>\n                    </table>\n                </td>\n                <td class="half right wrapper last">\n                    <table class="columns">\n                        <tr>\n                            <td class="panel sidebar-links">\n                                <h6>Header Thing</h6>\n                                <p>Sub-head or something</p>\n                                <table>\n                                    <tr>\n                                        <td>\n                                            <p><a href="#">Just a Plain Link &raquo;</a></p>\n                                        </td>\n                                    </tr>\n                                    <tr>\n                                        <td>\n                                            <hr/>\n                                        </td>\n                                    </tr>\n                                    <tr>\n                                        <td>\n                                            <p><a href="#">Just a Plain Link &raquo;</a></p>\n                                        </td>\n                                    </tr>\n                                    <tr>\n                                        <td>\n                                            <hr/>\n                                        </td>\n                                    </tr>\n                                    <tr>\n                                        <td>\n                                            <p><a href="#">Just a Plain Link &raquo;</a></p>\n                                        </td>\n                                    </tr>\n                                    <tr>\n                                        <td>\n                                            <hr/>\n                                        </td>\n                                    </tr>\n                                    <tr>\n                                        <td>\n                                            <p><a href="#">Just a Plain Link &raquo;</a></p>\n                                        </td>\n                                    </tr>\n                                    <tr>\n                                        <td>\n                                            <hr/>\n                                        </td>\n                                    </tr>\n                                    <tr>\n                                        <td>\n                                            <p><a href="#">Just a Plain Link &raquo;</a></p>\n                                        </td>\n                                    </tr>\n                                    <tr>\n                                        <td>\n                                            <hr/>\n                                        </td>\n                                    </tr>\n                                    <tr>\n                                        <td>\n                                            <p><a href="#">Just a Plain Link &raquo;</a></p>\n                                        </td>\n                                    </tr>\n                                    <tr>\n                                        <td>\n                                            <hr/>\n                                        </td>\n                                    </tr>\n                                    <tr>\n                                        <td>\n                                            <p><a href="#">Just a Plain Link &raquo;</a></p>\n                                        </td>\n                                    </tr>\n                                    <tr><td>&nbsp;</td></tr>\n                                </table>\n                            </td>\n                            <td class="expander"></td>\n                        </tr>\n                    </table>\n                    <br>\n                    <table class="columns">\n                        <tr>\n                            <td class="panel">\n                                <h6>Connect With Us:</h6>\n                                <table class="social-button facebook">\n                                    <tr>\n                                        <td>\n                                            <a href="#">Facebook</a>\n                                        </td>\n                                    </tr>\n                                </table>\n                                <hr>\n                                <table class="social-button twitter">\n                                    <tr>\n                                        <td>\n                                            <a href="#">Twitter</a>\n                                        </td>\n                                    </tr>\n                                </table>\n                                <hr>\n                                <table class="social-button google-plus">\n                                    <tr>\n                                        <td>\n                                            <a href="#">Google +</a>\n                                        </td>\n                                    </tr>\n                                </table>\n                                <br>\n                                <h6>Contact Info:</h6>\n                                {{depend store_phone}}\n                                <p>\n                                    <b>Call Us:</b>\n                                    <a href="tel:{{var phone}}">{{var store_phone}}</a>\n                                </p>\n                                {{/depend}}\n                                {{depend store_hours}}\n                                <p><span class="no-link">{{var store_hours}}</span><br></p>\n                                {{/depend}}\n                                {{depend store_email}}\n                                <p><b>Email:</b> <a href="mailto:{{var store_email}}">{{var store_email}}</a></p>\n                                {{/depend}}\n                            </td>\n                            <td class="expander"></td>\n                        </tr>\n                    </table>\n                </td>\n            </tr>\n        </table>\n        <table class="row">\n            <tr>\n                <td class="full wrapper">\n                    {{block type="catalog/product_new" template="email/catalog/product/new.phtml" products_count="4"\n                    column_count="4" }}\n                </td>\n            </tr>\n        </table>\n        <table class="row">\n            <tr>\n                <td class="full wrapper last">\n                    <table class="columns">\n                        <tr>\n                            <td align="center">\n                                <center>\n                                    <p><a href="#">Terms</a> | <a href="#">Privacy</a> | <a href="#">Unsubscribe</a></p>\n                                </center>\n                            </td>\n                            <td class="expander"></td>\n                        </tr>\n                    </table>\n                </td>\n            </tr>\n        </table>\n    </td>\n</tr>\n</table>\n\n{{template config_path="design/email/footer"}}', NULL, NULL, 2, 'Example Subject', 'Owner', 'owner@example.com', 1, '2015-04-24 07:41:18', '2015-04-24 07:41:18');

CREATE TABLE `#__oauth_consumer` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `created_at` timestamp NOT NULL COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  `name` varchar(255) NOT NULL COMMENT 'Name of consumer',
  `key` varchar(32) NOT NULL COMMENT 'Key code',
  `secret` varchar(32) NOT NULL COMMENT 'Secret code',
  `callback_url` varchar(255) DEFAULT NULL COMMENT 'Callback URL',
  `rejected_callback_url` varchar(255) NOT NULL COMMENT 'Rejected callback URL',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `UNQ_OAUTH_CONSUMER_KEY` (`key`),
  UNIQUE KEY `UNQ_OAUTH_CONSUMER_SECRET` (`secret`),
  KEY `IDX_OAUTH_CONSUMER_CREATED_AT` (`created_at`),
  KEY `IDX_OAUTH_CONSUMER_UPDATED_AT` (`updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='OAuth Consumers';


CREATE TABLE `#__oauth_nonce` (
  `nonce` varchar(32) NOT NULL COMMENT 'Nonce String',
  `timestamp` int(10) unsigned NOT NULL COMMENT 'Nonce Timestamp',
  UNIQUE KEY `UNQ_OAUTH_NONCE_NONCE` (`nonce`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='oauth_nonce';


CREATE TABLE `#__oauth_token` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity ID',
  `consumer_id` int(10) unsigned NOT NULL COMMENT 'Consumer ID',
  `admin_id` int(10) unsigned DEFAULT NULL COMMENT 'Admin user ID',
  `customer_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer user ID',
  `type` varchar(16) NOT NULL COMMENT 'Token Type',
  `token` varchar(32) NOT NULL COMMENT 'Token',
  `secret` varchar(32) NOT NULL COMMENT 'Token Secret',
  `verifier` varchar(32) DEFAULT NULL COMMENT 'Token Verifier',
  `callback_url` varchar(255) NOT NULL COMMENT 'Token Callback URL',
  `revoked` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Is Token revoked',
  `authorized` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Is Token authorized',
  `created_at` timestamp NOT NULL COMMENT 'Token creation timestamp',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `UNQ_OAUTH_TOKEN_TOKEN` (`token`),
  KEY `IDX_OAUTH_TOKEN_CONSUMER_ID` (`consumer_id`),
  KEY `FK_OAUTH_TOKEN_ADMIN_ID_ADMIN_USER_USER_ID` (`admin_id`),
  KEY `FK_OAUTH_TOKEN_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='OAuth Tokens';





CREATE TABLE `#__oscommerce_import_type` (
  `type_id` int(2) unsigned NOT NULL AUTO_INCREMENT,
  `type_code` varchar(32) NOT NULL,
  `type_name` varchar(255) NOT NULL,
  PRIMARY KEY (`type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 ;

INSERT INTO `#__oscommerce_import_type` (`type_id`, `type_code`, `type_name`) VALUES
(1, 'website', 'Website'),
(2, 'store', 'Store'),
(3, 'category', 'Category'),
(4, 'product', 'Product'),
(5, 'customer', 'Customer'),
(6, 'order', 'Order'),
(7, 'group', 'Store Group'),
(8, 'taxclass', 'Product Tax Class'),
(9, 'root_category', 'Root Category');

CREATE TABLE `#__oscommerce_orders` (
  `osc_magento_id` int(11) NOT NULL AUTO_INCREMENT,
  `orders_id` int(11) NOT NULL,
  `customers_id` int(11) NOT NULL DEFAULT '0',
  `magento_customers_id` int(11) NOT NULL DEFAULT '0',
  `import_id` int(11) NOT NULL DEFAULT '0',
  `website_id` int(11) NOT NULL DEFAULT '0',
  `customers_name` varchar(64) NOT NULL DEFAULT '',
  `customers_company` varchar(32) DEFAULT NULL,
  `customers_street_address` varchar(64) NOT NULL DEFAULT '',
  `customers_suburb` varchar(32) DEFAULT NULL,
  `customers_city` varchar(32) NOT NULL DEFAULT '',
  `customers_postcode` varchar(10) NOT NULL DEFAULT '',
  `customers_state` varchar(32) DEFAULT NULL,
  `customers_country` varchar(32) NOT NULL DEFAULT '',
  `customers_telephone` varchar(32) NOT NULL DEFAULT '',
  `customers_email_address` varchar(96) NOT NULL DEFAULT '',
  `customers_address_format_id` int(5) NOT NULL DEFAULT '0',
  `delivery_name` varchar(64) NOT NULL DEFAULT '',
  `delivery_company` varchar(32) DEFAULT NULL,
  `delivery_street_address` varchar(64) NOT NULL DEFAULT '',
  `delivery_suburb` varchar(32) DEFAULT NULL,
  `delivery_city` varchar(32) NOT NULL DEFAULT '',
  `delivery_postcode` varchar(10) NOT NULL DEFAULT '',
  `delivery_state` varchar(32) DEFAULT NULL,
  `delivery_country` varchar(32) NOT NULL DEFAULT '',
  `delivery_address_format_id` int(5) NOT NULL DEFAULT '0',
  `billing_name` varchar(64) NOT NULL DEFAULT '',
  `billing_company` varchar(32) DEFAULT NULL,
  `billing_street_address` varchar(64) NOT NULL DEFAULT '',
  `billing_suburb` varchar(32) DEFAULT NULL,
  `billing_city` varchar(32) NOT NULL DEFAULT '',
  `billing_postcode` varchar(10) NOT NULL DEFAULT '',
  `billing_state` varchar(32) DEFAULT NULL,
  `billing_country` varchar(32) NOT NULL DEFAULT '',
  `billing_address_format_id` int(5) NOT NULL DEFAULT '0',
  `payment_method` varchar(255) NOT NULL DEFAULT '',
  `cc_type` varchar(20) DEFAULT NULL,
  `cc_owner` varchar(64) DEFAULT NULL,
  `cc_number` varchar(32) DEFAULT NULL,
  `cc_expires` varchar(4) DEFAULT NULL,
  `last_modified` datetime DEFAULT NULL,
  `date_purchased` datetime DEFAULT NULL,
  `orders_status` varchar(32) DEFAULT NULL,
  `orders_date_finished` datetime DEFAULT NULL,
  `currency` char(3) DEFAULT NULL,
  `currency_value` decimal(14,6) DEFAULT NULL,
  `currency_symbol` char(3) DEFAULT NULL,
  `orders_total` decimal(14,6) DEFAULT NULL,
  PRIMARY KEY (`osc_magento_id`),
  KEY `idx_orders_customers_id` (`customers_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE `#__oscommerce_orders_products` (
  `orders_products_id` int(11) NOT NULL AUTO_INCREMENT,
  `osc_magento_id` int(11) NOT NULL DEFAULT '0',
  `products_id` int(11) NOT NULL DEFAULT '0',
  `products_model` varchar(12) DEFAULT NULL,
  `products_name` varchar(64) NOT NULL DEFAULT '',
  `products_price` decimal(15,4) NOT NULL DEFAULT '0.0000',
  `final_price` decimal(15,4) NOT NULL DEFAULT '0.0000',
  `products_tax` decimal(7,4) NOT NULL DEFAULT '0.0000',
  `products_quantity` int(2) NOT NULL DEFAULT '0',
  PRIMARY KEY (`orders_products_id`),
  KEY `idx_orders_products_osc_magento_id` (`osc_magento_id`),
  KEY `idx_orders_products_products_id` (`products_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE `#__oscommerce_orders_status_history` (
  `orders_status_history_id` int(11) NOT NULL AUTO_INCREMENT,
  `osc_magento_id` int(11) NOT NULL DEFAULT '0',
  `orders_status_id` int(5) NOT NULL DEFAULT '0',
  `date_added` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
  `customer_notified` int(1) DEFAULT '0',
  `comments` mediumtext,
  `orders_status` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`orders_status_history_id`),
  KEY `idx_orders_status_history_osc_magento_id` (`osc_magento_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE `#__oscommerce_orders_total` (
  `orders_total_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `osc_magento_id` int(11) NOT NULL DEFAULT '0',
  `title` varchar(255) NOT NULL DEFAULT '',
  `text` varchar(255) NOT NULL DEFAULT '',
  `value` decimal(15,4) NOT NULL DEFAULT '0.0000',
  `class` varchar(32) NOT NULL DEFAULT '',
  `sort_order` int(11) NOT NULL DEFAULT '0',
  PRIMARY KEY (`orders_total_id`),
  KEY `idx_orders_total_osc_magento_id` (`osc_magento_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE `#__oscommerce_ref` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `import_id` int(10) NOT NULL,
  `type_id` int(10) NOT NULL,
  `value` int(10) NOT NULL,
  `ref_id` int(10) NOT NULL,
  `created_at` datetime DEFAULT NULL,
  `user_id` int(10) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `#__paybox_api_debug` (
  `debug_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `debug_at` timestamp NOT NULL,
  `real_order_id` varchar(50) NOT NULL DEFAULT '',
  `request_body` text,
  `response_body` text,
  PRIMARY KEY (`debug_id`),
  KEY `debug_at` (`debug_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `#__paybox_question_number` (
  `account_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `account_hash` varchar(50) NOT NULL DEFAULT '',
  `increment_value` int(10) unsigned NOT NULL DEFAULT '1',
  `reset_date` timestamp NOT NULL,
  PRIMARY KEY (`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=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=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE `#__paypal_api_debug` (
  `debug_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `debug_at` timestamp NOT NULL,
  `request_body` text,
  `response_body` text,
  PRIMARY KEY (`debug_id`),
  KEY `debug_at` (`debug_at`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;


CREATE TABLE `#__paypal_cert` (
  `cert_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Cert Id',
  `website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website Id',
  `content` text COMMENT 'Content',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  PRIMARY KEY (`cert_id`),
  KEY `IDX_PAYPAL_CERT_WEBSITE_ID` (`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Paypal Certificate Table';


CREATE TABLE `#__paypal_payment_transaction` (
  `transaction_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `txn_id` varchar(100) DEFAULT NULL COMMENT 'Txn Id',
  `additional_information` blob COMMENT 'Additional Information',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  PRIMARY KEY (`transaction_id`),
  UNIQUE KEY `UNQ_PAYPAL_PAYMENT_TRANSACTION_TXN_ID` (`txn_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='PayPal Payflow Link Payment Transaction';


CREATE TABLE `#__paypal_settlement_report` (
  `report_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Report Id',
  `report_date` timestamp NULL DEFAULT NULL COMMENT 'Report Date',
  `account_id` varchar(64) DEFAULT NULL COMMENT 'Account Id',
  `filename` varchar(24) DEFAULT NULL COMMENT 'Filename',
  `last_modified` timestamp NULL DEFAULT NULL COMMENT 'Last Modified',
  PRIMARY KEY (`report_id`),
  UNIQUE KEY `UNQ_PAYPAL_SETTLEMENT_REPORT_REPORT_DATE_ACCOUNT_ID` (`report_date`,`account_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Paypal Settlement Report Table';


CREATE TABLE `#__paypal_settlement_report_row` (
  `row_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Row Id',
  `report_id` int(10) unsigned NOT NULL COMMENT 'Report Id',
  `transaction_id` varchar(19) DEFAULT NULL COMMENT 'Transaction Id',
  `invoice_id` varchar(127) DEFAULT NULL COMMENT 'Invoice Id',
  `paypal_reference_id` varchar(19) DEFAULT NULL COMMENT 'Paypal Reference Id',
  `paypal_reference_id_type` varchar(3) DEFAULT NULL COMMENT 'Paypal Reference Id Type',
  `transaction_event_code` varchar(5) DEFAULT NULL COMMENT 'Transaction Event Code',
  `transaction_initiation_date` timestamp NULL DEFAULT NULL COMMENT 'Transaction Initiation Date',
  `transaction_completion_date` timestamp NULL DEFAULT NULL COMMENT 'Transaction Completion Date',
  `transaction_debit_or_credit` varchar(2) NOT NULL DEFAULT 'CR' COMMENT 'Transaction Debit Or Credit',
  `gross_transaction_amount` decimal(20,6) NOT NULL DEFAULT '0.000000' COMMENT 'Gross Transaction Amount',
  `gross_transaction_currency` varchar(3) DEFAULT '' COMMENT 'Gross Transaction Currency',
  `fee_debit_or_credit` varchar(2) DEFAULT NULL COMMENT 'Fee Debit Or Credit',
  `fee_amount` decimal(20,6) NOT NULL DEFAULT '0.000000' COMMENT 'Fee Amount',
  `fee_currency` varchar(3) DEFAULT NULL COMMENT 'Fee Currency',
  `custom_field` varchar(255) DEFAULT NULL COMMENT 'Custom Field',
  `consumer_id` varchar(127) DEFAULT NULL COMMENT 'Consumer Id',
  `payment_tracking_id` varchar(255) DEFAULT NULL COMMENT 'Payment Tracking ID',
  `store_id` varchar(50) DEFAULT NULL COMMENT 'Store ID',
  PRIMARY KEY (`row_id`),
  KEY `IDX_PAYPAL_SETTLEMENT_REPORT_ROW_REPORT_ID` (`report_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Paypal Settlement Report Row Table';


CREATE TABLE `#__paypaluk_api_debug` (
  `debug_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `debug_at` timestamp NOT NULL,
  `request_body` text,
  `response_body` text,
  PRIMARY KEY (`debug_id`),
  KEY `debug_at` (`debug_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `#__permission_block` (
  `block_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Block ID',
  `block_name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Block Name',
  `is_allowed` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Mark that block can be processed by filters',
  PRIMARY KEY (`block_id`),
  UNIQUE KEY `UNQ_JE1C43_PERMISSION_BLOCK_BLOCK_NAME` (`block_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='System blocks that can be processed via content filter';

INSERT INTO `#__permission_block` (`block_id`, `block_name`, `is_allowed`) VALUES
(1, 'core/template', 1),
(2, 'catalog/product_new', 1),
(3, 'joomlart_jmproducts/list', 1),
(4, 'joomlart_jmproducts/filter', 1),
(5, 'joomlart_jmproducts/special', 1),
(6, 'joomlart_jmslideshow/list', 1),
(7, 'jmmegamenu/jmmegamenu', 1),
(8, 'newsletter/subscribe', 1);

CREATE TABLE `#__permission_variable` (
  `variable_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Variable ID',
  `variable_name` varchar(255) NOT NULL DEFAULT '' COMMENT 'Config Path',
  `is_allowed` tinyint(1) NOT NULL DEFAULT '0' COMMENT 'Mark that config can be processed by filters',
  PRIMARY KEY (`variable_id`,`variable_name`),
  UNIQUE KEY `UNQ_JE1C43_PERMISSION_VARIABLE_VARIABLE_NAME` (`variable_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='System variables that can be processed via content filter';

INSERT INTO `#__permission_variable` (`variable_id`, `variable_name`, `is_allowed`) VALUES
(1, 'trans_email/ident_support/name', 1),
(2, 'trans_email/ident_support/email', 1),
(3, 'web/unsecure/base_url', 1),
(4, 'web/secure/base_url', 1),
(5, 'trans_email/ident_general/name', 1),
(6, 'trans_email/ident_general/email', 1),
(7, 'trans_email/ident_sales/name', 1),
(8, 'trans_email/ident_sales/email', 1),
(9, 'trans_email/ident_custom1/name', 1),
(10, 'trans_email/ident_custom1/email', 1),
(11, 'trans_email/ident_custom2/name', 1),
(12, 'trans_email/ident_custom2/email', 1),
(13, 'general/store_information/name', 1),
(14, 'general/store_information/phone', 1),
(15, 'general/store_information/address', 1);

CREATE TABLE `#__persistent_session` (
  `persistent_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Session id',
  `key` varchar(50) NOT NULL COMMENT 'Unique cookie key',
  `customer_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer id',
  `website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID',
  `info` text COMMENT 'Session Data',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  PRIMARY KEY (`persistent_id`),
  UNIQUE KEY `IDX_PERSISTENT_SESSION_KEY` (`key`),
  UNIQUE KEY `IDX_PERSISTENT_SESSION_CUSTOMER_ID` (`customer_id`),
  KEY `IDX_PERSISTENT_SESSION_UPDATED_AT` (`updated_at`),
  KEY `FK_PERSISTENT_SESSION_WEBSITE_ID_CORE_WEBSITE_WEBSITE_ID` (`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Persistent Session';


CREATE TABLE `#__poll` (
  `poll_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Poll Id',
  `poll_title` varchar(255) DEFAULT NULL COMMENT 'Poll title',
  `votes_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Votes Count',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store id',
  `date_posted` timestamp NOT NULL COMMENT 'Date posted',
  `date_closed` timestamp NULL DEFAULT NULL COMMENT 'Date closed',
  `active` smallint(6) NOT NULL DEFAULT '1' COMMENT 'Is active',
  `closed` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Is closed',
  `answers_display` smallint(6) DEFAULT NULL COMMENT 'Answers display',
  PRIMARY KEY (`poll_id`),
  KEY `IDX_POLL_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Poll';

INSERT INTO `#__poll` (`poll_id`, `poll_title`, `votes_count`, `store_id`, `date_posted`, `date_closed`, `active`, `closed`, `answers_display`) VALUES
(1, 'What is your favorite color', 7, 1, '2007-06-15 19:17:49', '2007-08-31 07:41:32', 1, 1, NULL),
(2, 'What is your favorite Magento feature?', 4709, 0, '2011-11-11 09:26:20', NULL, 1, 0, NULL);

CREATE TABLE `#__poll_answer` (
  `answer_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Answer Id',
  `poll_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Poll Id',
  `answer_title` varchar(255) DEFAULT NULL COMMENT 'Answer title',
  `votes_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Votes Count',
  `answer_order` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Answers display',
  PRIMARY KEY (`answer_id`),
  KEY `IDX_POLL_ANSWER_POLL_ID` (`poll_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Poll Answers';

INSERT INTO `#__poll_answer` (`answer_id`, `poll_id`, `answer_title`, `votes_count`, `answer_order`) VALUES
(1, 1, 'Green', 0, 0),
(2, 1, 'Red', 0, 0),
(3, 1, 'Black', 2, 0),
(4, 1, 'Magenta', 5, 0),
(5, 2, 'Layered Navigation', 1889, 0),
(6, 2, 'Price Rules', 1340, 0),
(7, 2, 'Category Management', 725, 0),
(8, 2, 'Compare Products', 762, 0);

CREATE TABLE `#__poll_store` (
  `poll_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Poll Id',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store id',
  PRIMARY KEY (`poll_id`,`store_id`),
  KEY `IDX_POLL_STORE_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Poll Store';

INSERT INTO `#__poll_store` (`poll_id`, `store_id`) VALUES
(2, 1),
(2, 2),
(2, 3);

CREATE TABLE `#__poll_vote` (
  `vote_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Vote Id',
  `poll_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Poll Id',
  `poll_answer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Poll answer id',
  `ip_address` varbinary(16) DEFAULT NULL,
  `customer_id` int(11) DEFAULT NULL COMMENT 'Customer id',
  `vote_time` timestamp NULL DEFAULT NULL COMMENT 'Date closed',
  PRIMARY KEY (`vote_id`),
  KEY `IDX_POLL_VOTE_POLL_ANSWER_ID` (`poll_answer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Poll Vote';

INSERT INTO `#__poll_vote` (`vote_id`, `poll_id`, `poll_answer_id`, `ip_address`, `customer_id`, `vote_time`) VALUES
(1, 2, 7, '\n\0\0�', NULL, '2011-11-11 02:26:19');

CREATE TABLE `#__product_alert_price` (
  `alert_price_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Product alert price id',
  `customer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer id',
  `product_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Product id',
  `price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Price amount',
  `website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website id',
  `add_date` timestamp NOT NULL COMMENT 'Product alert add date',
  `last_send_date` timestamp NULL DEFAULT NULL COMMENT 'Product alert last send date',
  `send_count` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Product alert send count',
  `status` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Product alert status',
  PRIMARY KEY (`alert_price_id`),
  KEY `IDX_PRODUCT_ALERT_PRICE_CUSTOMER_ID` (`customer_id`),
  KEY `IDX_PRODUCT_ALERT_PRICE_PRODUCT_ID` (`product_id`),
  KEY `IDX_PRODUCT_ALERT_PRICE_WEBSITE_ID` (`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Product Alert Price';


CREATE TABLE `#__product_alert_stock` (
  `alert_stock_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Product alert stock id',
  `customer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer id',
  `product_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Product id',
  `website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website id',
  `add_date` timestamp NOT NULL COMMENT 'Product alert add date',
  `send_date` timestamp NULL DEFAULT NULL COMMENT 'Product alert send date',
  `send_count` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Send Count',
  `status` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Product alert status',
  PRIMARY KEY (`alert_stock_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`),
  KEY `IDX_PRODUCT_ALERT_STOCK_CUSTOMER_ID` (`customer_id`),
  KEY `IDX_PRODUCT_ALERT_STOCK_PRODUCT_ID` (`product_id`),
  KEY `IDX_PRODUCT_ALERT_STOCK_WEBSITE_ID` (`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Product Alert Stock';


CREATE TABLE `#__protx_api_debug` (
  `debug_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `transaction_id` varchar(255) NOT NULL DEFAULT '',
  `debug_at` timestamp NOT NULL,
  `request_body` text,
  `response_body` text,
  PRIMARY KEY (`debug_id`),
  KEY `debug_at` (`debug_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;


CREATE TABLE `#__rating` (
  `rating_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rating Id',
  `entity_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Entity Id',
  `rating_code` varchar(64) NOT NULL COMMENT 'Rating Code',
  `position` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Position On Frontend',
  PRIMARY KEY (`rating_id`),
  UNIQUE KEY `UNQ_RATING_RATING_CODE` (`rating_code`),
  KEY `IDX_RATING_ENTITY_ID` (`entity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Ratings';

INSERT INTO `#__rating` (`rating_id`, `entity_id`, `rating_code`, `position`) VALUES
(1, 1, 'Quality', 0),
(2, 1, 'Value', 0),
(3, 1, 'Price', 0);

CREATE TABLE `#__rating_entity` (
  `entity_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `entity_code` varchar(64) NOT NULL COMMENT 'Entity Code',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `UNQ_RATING_ENTITY_ENTITY_CODE` (`entity_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Rating entities';

INSERT INTO `#__rating_entity` (`entity_id`, `entity_code`) VALUES
(1, 'product'),
(2, 'product_review'),
(3, 'review');

CREATE TABLE `#__rating_option` (
  `option_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rating Option Id',
  `rating_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Id',
  `code` varchar(32) NOT NULL COMMENT 'Rating Option Code',
  `value` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Option Value',
  `position` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Ration option position on frontend',
  PRIMARY KEY (`option_id`),
  KEY `IDX_RATING_OPTION_RATING_ID` (`rating_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Rating options';

INSERT INTO `#__rating_option` (`option_id`, `rating_id`, `code`, `value`, `position`) VALUES
(1, 1, '1', 1, 1),
(2, 1, '2', 2, 2),
(3, 1, '3', 3, 3),
(4, 1, '4', 4, 4),
(5, 1, '5', 5, 5),
(6, 2, '1', 1, 1),
(7, 2, '2', 2, 2),
(8, 2, '3', 3, 3),
(9, 2, '4', 4, 4),
(10, 2, '5', 5, 5),
(11, 3, '1', 1, 1),
(12, 3, '2', 2, 2),
(13, 3, '3', 3, 3),
(14, 3, '4', 4, 4),
(15, 3, '5', 5, 5);

CREATE TABLE `#__rating_option_vote` (
  `vote_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Vote id',
  `option_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Vote option id',
  `remote_ip` varchar(50) DEFAULT NULL,
  `remote_ip_long` varbinary(16) DEFAULT NULL,
  `customer_id` int(10) unsigned DEFAULT '0' COMMENT 'Customer Id',
  `entity_pk_value` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Product id',
  `rating_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Rating id',
  `review_id` bigint(20) unsigned DEFAULT NULL COMMENT 'Review id',
  `percent` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Percent amount',
  `value` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Vote option value',
  PRIMARY KEY (`vote_id`),
  KEY `IDX_RATING_OPTION_VOTE_OPTION_ID` (`option_id`),
  KEY `FK_RATING_OPTION_VOTE_REVIEW_ID_REVIEW_REVIEW_ID` (`review_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Rating option values';

INSERT INTO `#__rating_option_vote` (`vote_id`, `option_id`, `remote_ip`, `remote_ip_long`, `customer_id`, `entity_pk_value`, `rating_id`, `review_id`, `percent`, `value`) VALUES
(1, 14, '10.0.0.131', '\n\0\0�', NULL, 169, 3, 1, 80, 4),
(2, 10, '10.0.0.131', '\n\0\0�', NULL, 169, 2, 1, 100, 5),
(3, 5, '10.0.0.131', '\n\0\0�', NULL, 169, 1, 1, 100, 5),
(4, 14, '10.0.0.131', '\n\0\0�', NULL, 179, 3, 2, 80, 4),
(5, 8, '10.0.0.131', '\n\0\0�', NULL, 179, 2, 2, 60, 3),
(6, 3, '10.0.0.131', '\n\0\0�', NULL, 179, 1, 2, 60, 3),
(7, 15, '10.0.0.131', '\n\0\0�', NULL, 178, 3, 3, 100, 5),
(8, 9, '10.0.0.131', '\n\0\0�', NULL, 178, 2, 3, 80, 4),
(9, 3, '10.0.0.131', '\n\0\0�', NULL, 178, 1, 3, 60, 3),
(10, 14, '10.0.0.131', '\n\0\0�', NULL, 176, 3, 4, 80, 4),
(11, 10, '10.0.0.131', '\n\0\0�', NULL, 176, 2, 4, 100, 5),
(12, 4, '10.0.0.131', '\n\0\0�', NULL, 176, 1, 4, 80, 4),
(13, 14, '10.0.0.131', '\n\0\0�', NULL, 174, 3, 5, 80, 4),
(14, 8, '10.0.0.131', '\n\0\0�', NULL, 174, 2, 5, 60, 3),
(15, 5, '10.0.0.131', '\n\0\0�', NULL, 174, 1, 5, 100, 5),
(16, 15, '10.0.0.131', '\n\0\0�', NULL, 173, 3, 6, 100, 5),
(17, 10, '10.0.0.131', '\n\0\0�', NULL, 173, 2, 6, 100, 5),
(18, 4, '10.0.0.131', '\n\0\0�', NULL, 173, 1, 6, 80, 4),
(19, 14, '10.0.0.131', '\n\0\0�', NULL, 172, 3, 7, 80, 4),
(20, 10, '10.0.0.131', '\n\0\0�', NULL, 172, 2, 7, 100, 5),
(21, 5, '10.0.0.131', '\n\0\0�', NULL, 172, 1, 7, 100, 5),
(22, 13, '10.0.0.131', '\n\0\0�', NULL, 171, 3, 8, 60, 3),
(23, 9, '10.0.0.131', '\n\0\0�', NULL, 171, 2, 8, 80, 4),
(24, 3, '10.0.0.131', '\n\0\0�', NULL, 171, 1, 8, 60, 3),
(25, 14, '10.0.0.131', '\n\0\0�', NULL, 170, 3, 9, 80, 4),
(26, 8, '10.0.0.131', '\n\0\0�', NULL, 170, 2, 9, 60, 3),
(27, 4, '10.0.0.131', '\n\0\0�', NULL, 170, 1, 9, 80, 4),
(28, 13, '10.0.0.131', '\n\0\0�', NULL, 181, 3, 10, 60, 3),
(29, 10, '10.0.0.131', '\n\0\0�', NULL, 181, 2, 10, 100, 5),
(30, 4, '10.0.0.131', '\n\0\0�', NULL, 181, 1, 10, 80, 4),
(31, 14, '10.0.0.131', '\n\0\0�', NULL, 177, 3, 11, 80, 4),
(32, 10, '10.0.0.131', '\n\0\0�', NULL, 177, 2, 11, 100, 5),
(33, 5, '10.0.0.131', '\n\0\0�', NULL, 177, 1, 11, 100, 5),
(34, 15, '10.0.0.131', '\n\0\0�', NULL, 180, 3, 12, 100, 5),
(35, 9, '10.0.0.131', '\n\0\0�', NULL, 180, 2, 12, 80, 4),
(36, 3, '10.0.0.131', '\n\0\0�', NULL, 180, 1, 12, 60, 3),
(37, 15, '10.0.0.102', '\n\0\0f', 3, 173, 3, 13, 100, 5),
(38, 9, '10.0.0.102', '\n\0\0f', 3, 173, 2, 13, 80, 4),
(39, 3, '10.0.0.102', '\n\0\0f', 3, 173, 1, 13, 60, 3);

CREATE TABLE `#__rating_option_vote_aggregated` (
  `primary_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Vote aggregation id',
  `rating_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Rating id',
  `entity_pk_value` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Product id',
  `vote_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Vote dty',
  `vote_value_sum` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'General vote sum',
  `percent` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Vote percent',
  `percent_approved` smallint(6) DEFAULT '0' COMMENT 'Vote percent approved by admin',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Id',
  PRIMARY KEY (`primary_id`),
  KEY `IDX_RATING_OPTION_VOTE_AGGREGATED_RATING_ID` (`rating_id`),
  KEY `IDX_RATING_OPTION_VOTE_AGGREGATED_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Rating vote aggregated';

INSERT INTO `#__rating_option_vote_aggregated` (`primary_id`, `rating_id`, `entity_pk_value`, `vote_count`, `vote_value_sum`, `percent`, `percent_approved`, `store_id`) VALUES
(1, 3, 169, 1, 4, 80, 80, 0),
(2, 3, 169, 1, 4, 80, 80, 1),
(3, 2, 169, 1, 5, 100, 100, 0),
(4, 2, 169, 1, 5, 100, 100, 1),
(5, 1, 169, 1, 5, 100, 100, 0),
(6, 1, 169, 1, 5, 100, 100, 1),
(7, 3, 179, 1, 4, 80, 80, 0),
(8, 3, 179, 1, 4, 80, 80, 1),
(9, 2, 179, 1, 3, 60, 60, 0),
(10, 2, 179, 1, 3, 60, 60, 1),
(11, 1, 179, 1, 3, 60, 60, 0),
(12, 1, 179, 1, 3, 60, 60, 1),
(13, 3, 178, 1, 5, 100, 100, 0),
(14, 3, 178, 1, 5, 100, 100, 1),
(15, 2, 178, 1, 4, 80, 80, 0),
(16, 2, 178, 1, 4, 80, 80, 1),
(17, 1, 178, 1, 3, 60, 60, 0),
(18, 1, 178, 1, 3, 60, 60, 1),
(19, 3, 176, 1, 4, 80, 80, 0),
(20, 3, 176, 1, 4, 80, 80, 1),
(21, 2, 176, 1, 5, 100, 100, 0),
(22, 2, 176, 1, 5, 100, 100, 1),
(23, 1, 176, 1, 4, 80, 80, 0),
(24, 1, 176, 1, 4, 80, 80, 1),
(25, 3, 174, 1, 4, 80, 80, 0),
(26, 3, 174, 1, 4, 80, 80, 1),
(27, 2, 174, 1, 3, 60, 60, 0),
(28, 2, 174, 1, 3, 60, 60, 1),
(29, 1, 174, 1, 5, 100, 100, 0),
(30, 1, 174, 1, 5, 100, 100, 1),
(31, 3, 173, 2, 10, 100, 100, 0),
(32, 3, 173, 2, 10, 100, 100, 1),
(33, 2, 173, 2, 9, 90, 90, 0),
(34, 2, 173, 2, 9, 90, 90, 1),
(35, 1, 173, 2, 7, 70, 70, 0),
(36, 1, 173, 2, 7, 70, 70, 1),
(37, 3, 172, 1, 4, 80, 80, 0),
(38, 3, 172, 1, 4, 80, 80, 1),
(39, 2, 172, 1, 5, 100, 100, 0),
(40, 2, 172, 1, 5, 100, 100, 1),
(41, 1, 172, 1, 5, 100, 100, 0),
(42, 1, 172, 1, 5, 100, 100, 1),
(43, 3, 171, 1, 3, 60, 60, 0),
(44, 3, 171, 1, 3, 60, 60, 1),
(45, 2, 171, 1, 4, 80, 80, 0),
(46, 2, 171, 1, 4, 80, 80, 1),
(47, 1, 171, 1, 3, 60, 60, 0),
(48, 1, 171, 1, 3, 60, 60, 1),
(49, 3, 170, 1, 4, 80, 80, 0),
(50, 3, 170, 1, 4, 80, 80, 1),
(51, 2, 170, 1, 3, 60, 60, 0),
(52, 2, 170, 1, 3, 60, 60, 1),
(53, 1, 170, 1, 4, 80, 80, 0),
(54, 1, 170, 1, 4, 80, 80, 1),
(55, 3, 181, 1, 3, 60, 60, 0),
(56, 3, 181, 1, 3, 60, 60, 1),
(57, 2, 181, 1, 5, 100, 100, 0),
(58, 2, 181, 1, 5, 100, 100, 1),
(59, 1, 181, 1, 4, 80, 80, 0),
(60, 1, 181, 1, 4, 80, 80, 1),
(61, 3, 177, 1, 4, 80, 80, 0),
(62, 3, 177, 1, 4, 80, 80, 1),
(63, 2, 177, 1, 5, 100, 100, 0),
(64, 2, 177, 1, 5, 100, 100, 1),
(65, 1, 177, 1, 5, 100, 100, 0),
(66, 1, 177, 1, 5, 100, 100, 1),
(67, 3, 180, 1, 5, 100, 100, 0),
(68, 3, 180, 1, 5, 100, 100, 1),
(69, 2, 180, 1, 4, 80, 80, 0),
(70, 2, 180, 1, 4, 80, 80, 1),
(71, 1, 180, 1, 3, 60, 60, 0),
(72, 1, 180, 1, 3, 60, 60, 1);

CREATE TABLE `#__rating_store` (
  `rating_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Rating id',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store id',
  PRIMARY KEY (`rating_id`,`store_id`),
  KEY `IDX_RATING_STORE_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rating Store';

INSERT INTO `#__rating_store` (`rating_id`, `store_id`) VALUES
(1, 0),
(1, 1),
(1, 2),
(1, 3),
(2, 0),
(2, 1),
(2, 2),
(2, 3),
(3, 0),
(3, 1),
(3, 2),
(3, 3);

CREATE TABLE `#__rating_title` (
  `rating_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Id',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Id',
  `value` varchar(255) NOT NULL COMMENT 'Rating Label',
  PRIMARY KEY (`rating_id`,`store_id`),
  KEY `IDX_RATING_TITLE_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Rating Title';


CREATE TABLE `#__report_compared_product_index` (
  `index_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Index Id',
  `visitor_id` int(10) unsigned DEFAULT NULL COMMENT 'Visitor Id',
  `customer_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer Id',
  `product_id` int(10) unsigned NOT NULL COMMENT 'Product Id',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `added_at` timestamp NOT NULL COMMENT 'Added At',
  PRIMARY KEY (`index_id`),
  UNIQUE KEY `UNQ_REPORT_COMPARED_PRODUCT_INDEX_VISITOR_ID_PRODUCT_ID` (`visitor_id`,`product_id`),
  UNIQUE KEY `UNQ_REPORT_COMPARED_PRODUCT_INDEX_CUSTOMER_ID_PRODUCT_ID` (`customer_id`,`product_id`),
  KEY `IDX_REPORT_COMPARED_PRODUCT_INDEX_STORE_ID` (`store_id`),
  KEY `IDX_REPORT_COMPARED_PRODUCT_INDEX_ADDED_AT` (`added_at`),
  KEY `IDX_REPORT_COMPARED_PRODUCT_INDEX_PRODUCT_ID` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Reports Compared Product Index Table';

INSERT INTO `#__report_compared_product_index` (`index_id`, `visitor_id`, `customer_id`, `product_id`, `store_id`, `added_at`) VALUES
(1, NULL, 3, 179, 1, '2012-08-16 15:18:01'),
(2, 174, 3, 180, 1, '2012-08-24 04:16:53'),
(3, 174, 3, 169, 1, '2012-08-24 04:14:13'),
(4, 164, 3, 173, 1, '2012-08-23 03:02:41'),
(5, 172, 3, 171, 1, '2012-08-24 04:14:59');

CREATE TABLE `#__report_event` (
  `event_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Event Id',
  `logged_at` timestamp NOT NULL COMMENT 'Logged At',
  `event_type_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Event Type Id',
  `object_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Object Id',
  `subject_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Subject Id',
  `subtype` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Subtype',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store Id',
  PRIMARY KEY (`event_id`),
  KEY `IDX_REPORT_EVENT_EVENT_TYPE_ID` (`event_type_id`),
  KEY `IDX_REPORT_EVENT_SUBJECT_ID` (`subject_id`),
  KEY `IDX_REPORT_EVENT_OBJECT_ID` (`object_id`),
  KEY `IDX_REPORT_EVENT_SUBTYPE` (`subtype`),
  KEY `IDX_REPORT_EVENT_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Reports Event Table';

INSERT INTO `#__report_event` (`event_id`, `logged_at`, `event_type_id`, `object_id`, `subject_id`, `subtype`, `store_id`) VALUES
(1, '2010-03-02 07:45:25', 1, 39, 1, 1, 1),
(2, '2011-04-06 03:12:57', 4, 18, 2, 0, 1),
(3, '2011-04-06 03:23:48', 1, 123, 2, 0, 1),
(4, '2011-04-06 03:24:02', 4, 123, 2, 0, 1),
(5, '2011-04-06 04:04:10', 1, 17, 2, 0, 1),
(6, '2011-04-06 04:04:52', 1, 17, 2, 0, 1),
(7, '2011-04-06 04:04:59', 1, 17, 2, 0, 1),
(8, '2011-04-06 04:19:39', 1, 42, 2, 0, 1),
(9, '2011-04-06 04:26:45', 1, 17, 2, 0, 1),
(10, '2011-04-06 04:27:00', 1, 17, 2, 0, 1),
(11, '2011-04-06 04:27:18', 1, 17, 2, 0, 1),
(12, '2011-04-06 04:27:28', 1, 17, 2, 0, 1),
(13, '2011-04-06 04:29:30', 1, 17, 2, 0, 1),
(14, '2011-04-06 04:30:45', 1, 17, 2, 0, 1),
(15, '2011-04-06 04:31:40', 5, 52, 2, 0, 1),
(16, '2011-04-06 04:36:22', 1, 17, 2, 0, 1),
(17, '2011-04-06 08:01:01', 1, 17, 2, 1, 1),
(18, '2011-04-06 08:01:36', 1, 17, 1, 1, 1),
(19, '2011-04-06 08:02:50', 1, 17, 3, 1, 1),
(20, '2011-04-06 08:04:30', 1, 51, 1, 1, 1),
(21, '2011-04-06 08:05:20', 1, 27, 2, 1, 1),
(22, '2011-04-06 08:05:43', 1, 16, 1, 1, 1),
(23, '2011-04-06 08:05:57', 1, 18, 1, 1, 1),
(24, '2011-04-06 08:06:44', 1, 18, 4, 1, 1),
(25, '2011-04-06 08:06:59', 1, 123, 4, 1, 1),
(26, '2011-04-06 08:07:06', 1, 16, 1, 1, 1),
(27, '2011-04-06 08:07:22', 1, 17, 4, 1, 1),
(28, '2011-04-06 08:08:57', 1, 18, 5, 1, 1),
(29, '2011-04-06 08:09:45', 1, 18, 6, 1, 1),
(30, '2011-04-06 08:12:18', 1, 140, 4, 1, 1),
(31, '2011-04-06 09:26:15', 1, 46, 1, 1, 1),
(32, '2011-11-08 02:11:40', 1, 18, 1, 1, 1),
(33, '2011-11-08 02:12:51', 1, 18, 1, 1, 1),
(34, '2011-11-08 02:23:49', 1, 18, 1, 1, 1),
(35, '2011-11-08 03:37:20', 1, 18, 1, 1, 1),
(36, '2011-11-08 04:49:20', 4, 147, 12, 1, 1),
(37, '2011-11-08 07:03:22', 3, 53, 3, 0, 1),
(38, '2011-11-08 07:03:26', 3, 52, 3, 0, 1),
(39, '2011-11-08 07:03:31', 3, 51, 3, 0, 1),
(40, '2011-11-08 07:04:19', 1, 51, 3, 0, 1),
(41, '2011-11-08 07:05:27', 1, 51, 3, 0, 1),
(42, '2011-11-08 07:15:15', 1, 51, 3, 0, 1),
(43, '2011-11-08 07:17:01', 1, 51, 3, 0, 1),
(44, '2011-11-08 07:17:55', 1, 51, 3, 0, 1),
(45, '2011-11-08 07:18:13', 1, 51, 3, 0, 1),
(46, '2011-11-08 07:18:45', 1, 51, 3, 0, 1),
(47, '2011-11-08 07:19:42', 1, 51, 3, 0, 1),
(48, '2011-11-08 07:21:14', 1, 51, 3, 0, 1),
(49, '2011-11-08 07:28:58', 1, 51, 3, 0, 1),
(50, '2011-11-08 07:31:43', 1, 51, 3, 0, 1),
(51, '2011-11-08 07:32:06', 1, 51, 3, 0, 1),
(52, '2011-11-08 07:33:04', 1, 51, 3, 0, 1),
(53, '2011-11-08 07:33:14', 1, 51, 3, 0, 1),
(54, '2011-11-08 07:33:29', 1, 51, 3, 0, 1),
(55, '2011-11-08 07:34:01', 1, 51, 3, 0, 1),
(56, '2011-11-08 07:35:40', 1, 51, 3, 0, 1),
(57, '2011-11-08 07:36:36', 1, 51, 3, 0, 1),
(58, '2011-11-08 07:38:28', 1, 51, 3, 0, 1),
(59, '2011-11-08 07:40:27', 1, 51, 3, 0, 1),
(60, '2011-11-08 07:43:02', 2, 51, 3, 0, 1),
(61, '2011-11-08 07:46:16', 2, 51, 3, 0, 1),
(62, '2011-11-08 07:48:39', 2, 51, 3, 0, 1),
(63, '2011-11-08 07:51:12', 2, 51, 3, 0, 1),
(64, '2011-11-08 07:52:32', 2, 51, 3, 0, 1),
(65, '2011-11-08 08:09:32', 5, 53, 3, 0, 1),
(66, '2011-11-08 08:11:44', 1, 123, 3, 0, 1),
(67, '2011-11-08 09:05:58', 1, 53, 3, 0, 1),
(68, '2011-11-08 09:11:45', 1, 53, 3, 0, 1),
(69, '2011-11-08 09:12:01', 2, 53, 3, 0, 1),
(70, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(71, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(72, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(73, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(74, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(75, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(76, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(77, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(78, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(79, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(80, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(81, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(82, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(83, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(84, '2011-11-09 11:09:49', 1, 147, 3, 0, 1),
(85, '2011-11-09 04:10:13', 1, 147, 3, 0, 1),
(86, '2011-11-09 13:54:05', 1, 51, 3, 0, 1),
(87, '2011-11-09 06:59:18', 1, 156, 3, 0, 1),
(88, '2011-11-09 06:59:43', 1, 156, 3, 0, 1),
(89, '2011-11-09 06:59:58', 1, 156, 3, 0, 1),
(90, '2011-11-09 07:01:14', 1, 123, 3, 0, 1),
(91, '2011-11-09 07:02:51', 1, 123, 3, 0, 1),
(92, '2011-11-09 07:03:13', 1, 123, 3, 0, 1),
(93, '2011-11-09 07:03:56', 1, 123, 3, 0, 1),
(94, '2011-11-09 07:04:31', 1, 163, 3, 0, 1),
(95, '2011-11-09 07:07:36', 1, 163, 3, 0, 1),
(96, '2011-11-09 07:10:24', 1, 163, 3, 0, 1),
(97, '2011-11-09 07:11:29', 1, 17, 3, 0, 1),
(98, '2011-11-09 07:12:35', 1, 17, 3, 0, 1),
(99, '2011-11-09 07:13:21', 1, 133, 3, 0, 1),
(100, '2011-11-09 07:14:44', 4, 133, 3, 0, 1),
(101, '2011-11-09 07:59:38', 1, 51, 3, 0, 1),
(102, '2011-11-09 07:59:58', 4, 51, 3, 0, 1),
(103, '2011-11-09 09:25:41', 1, 163, 3, 0, 1),
(104, '2011-11-09 09:26:04', 5, 163, 3, 0, 1),
(105, '2011-11-09 09:27:52', 1, 119, 3, 0, 1),
(106, '2011-11-09 09:28:41', 1, 119, 3, 0, 1),
(107, '2011-11-09 09:29:01', 1, 119, 3, 0, 1),
(108, '2011-11-09 09:29:18', 4, 119, 3, 0, 1),
(109, '2011-11-09 09:34:35', 1, 119, 3, 0, 1),
(110, '2011-11-09 09:36:54', 1, 119, 3, 0, 1),
(111, '2011-11-09 09:38:33', 1, 119, 3, 0, 1),
(112, '2011-11-09 10:13:11', 1, 119, 3, 0, 1),
(113, '2011-11-10 01:45:03', 1, 119, 3, 0, 1),
(114, '2011-11-10 01:46:57', 1, 119, 3, 0, 1),
(115, '2011-11-10 01:47:34', 1, 119, 3, 0, 1),
(116, '2011-11-10 01:48:07', 1, 119, 3, 0, 1),
(117, '2011-11-10 01:48:26', 1, 119, 3, 0, 1),
(118, '2011-11-10 01:50:09', 1, 119, 3, 0, 1),
(119, '2011-11-10 01:50:40', 1, 119, 3, 0, 1),
(120, '2011-11-10 01:52:51', 1, 119, 3, 0, 1),
(121, '2011-11-10 01:53:49', 1, 119, 3, 0, 1),
(122, '2011-11-10 01:54:55', 1, 119, 3, 0, 1),
(123, '2011-11-10 01:55:31', 1, 119, 3, 0, 1),
(124, '2011-11-10 01:56:12', 1, 119, 3, 0, 1),
(125, '2011-11-10 02:08:37', 1, 147, 3, 0, 1),
(126, '2011-11-10 02:10:05', 1, 147, 3, 0, 1),
(127, '2011-11-10 02:13:56', 1, 147, 3, 0, 1),
(128, '2011-11-10 02:15:24', 1, 147, 3, 0, 1),
(129, '2011-11-10 02:18:20', 1, 147, 3, 0, 1),
(130, '2011-11-10 07:44:31', 1, 151, 21, 1, 1),
(131, '2011-11-10 08:50:29', 1, 151, 21, 1, 1),
(132, '2011-11-10 09:46:51', 1, 53, 21, 1, 1),
(133, '2011-11-10 09:47:31', 4, 53, 21, 1, 1),
(134, '2011-11-10 10:11:16', 1, 157, 21, 1, 1),
(135, '2011-11-10 10:12:14', 1, 157, 21, 1, 1),
(136, '2011-11-10 10:12:23', 1, 157, 21, 1, 1),
(137, '2011-11-10 10:12:31', 1, 157, 21, 1, 1),
(138, '2011-11-10 10:13:40', 1, 157, 21, 1, 1),
(139, '2011-11-11 02:24:43', 1, 147, 24, 1, 1),
(140, '2011-11-11 04:13:07', 1, 51, 25, 1, 1),
(141, '2011-11-11 04:26:45', 1, 147, 25, 1, 1),
(142, '2011-11-11 04:27:36', 1, 147, 25, 1, 1),
(143, '2011-11-11 04:28:29', 1, 147, 25, 1, 1),
(144, '2011-11-11 14:32:34', 1, 147, 3, 0, 1),
(145, '2011-11-11 14:32:34', 1, 147, 3, 0, 1),
(146, '2011-11-11 14:32:34', 1, 147, 3, 0, 1),
(147, '2011-11-11 08:25:06', 1, 147, 30, 1, 1),
(148, '2011-11-11 08:48:22', 1, 147, 3, 0, 1),
(149, '2011-11-11 08:51:38', 1, 147, 3, 0, 1),
(150, '2011-11-11 09:05:38', 1, 147, 3, 0, 1),
(151, '2011-11-11 09:06:53', 1, 147, 3, 0, 1),
(152, '2011-11-11 09:06:57', 1, 51, 30, 1, 1),
(153, '2011-11-11 09:07:05', 1, 51, 30, 1, 1),
(154, '2011-11-11 09:11:00', 1, 51, 30, 1, 1),
(155, '2011-11-11 09:11:26', 1, 147, 3, 0, 1),
(156, '2011-11-11 09:38:32', 1, 147, 3, 0, 1),
(157, '2011-11-11 09:38:44', 1, 51, 30, 1, 1),
(158, '2011-11-11 09:39:45', 1, 51, 30, 1, 1),
(159, '2011-11-11 09:39:59', 1, 51, 30, 1, 1),
(160, '2011-11-11 09:40:15', 1, 51, 30, 1, 1),
(161, '2011-11-11 09:40:18', 1, 51, 30, 1, 1),
(162, '2011-11-11 09:41:14', 1, 51, 30, 1, 1),
(163, '2011-11-11 09:41:21', 1, 51, 30, 1, 1),
(164, '2011-11-11 09:41:53', 1, 147, 3, 0, 1),
(165, '2011-11-11 09:42:13', 1, 51, 3, 0, 1),
(166, '2011-11-11 09:45:08', 1, 51, 30, 1, 1),
(167, '2011-11-11 09:45:10', 1, 51, 3, 0, 1),
(168, '2011-11-11 09:46:25', 1, 51, 3, 0, 1),
(169, '2011-11-11 09:46:29', 1, 51, 30, 1, 1),
(170, '2011-11-11 09:46:35', 1, 51, 30, 1, 1),
(171, '2011-11-11 09:46:43', 1, 51, 3, 0, 1),
(172, '2011-11-11 09:47:32', 1, 51, 30, 1, 1),
(173, '2011-11-11 09:48:27', 1, 51, 30, 1, 1),
(174, '2011-11-11 10:02:51', 1, 51, 30, 1, 1),
(175, '2011-11-11 10:09:25', 1, 51, 3, 0, 1),
(176, '2011-11-11 10:09:36', 1, 51, 30, 1, 1),
(177, '2011-11-11 10:09:50', 1, 51, 30, 1, 1),
(178, '2011-11-11 10:10:01', 1, 51, 30, 1, 1),
(179, '2011-11-11 10:10:21', 1, 51, 30, 1, 1),
(180, '2011-11-11 10:10:24', 1, 51, 3, 0, 1),
(181, '2011-11-11 10:13:09', 1, 51, 30, 1, 1),
(182, '2011-11-11 10:13:19', 1, 51, 30, 1, 1),
(183, '2011-11-11 10:13:43', 1, 51, 30, 1, 1),
(184, '2011-11-11 10:13:52', 1, 51, 30, 1, 1),
(185, '2011-11-11 10:14:09', 1, 51, 30, 1, 1),
(186, '2011-11-11 10:14:18', 1, 51, 30, 1, 1),
(187, '2011-11-11 10:14:21', 1, 51, 30, 1, 1),
(188, '2011-11-11 10:14:27', 1, 51, 30, 1, 1),
(189, '2011-11-11 10:14:59', 1, 51, 30, 1, 1),
(190, '2011-11-11 10:15:09', 1, 51, 30, 1, 1),
(191, '2011-11-11 10:18:54', 1, 51, 30, 1, 1),
(192, '2011-11-18 14:12:11', 1, 26, 3, 0, 1),
(193, '2011-11-18 14:12:11', 1, 26, 3, 0, 1),
(194, '2011-11-18 14:12:11', 1, 26, 3, 0, 1),
(195, '2011-11-18 14:11:28', 1, 26, 3, 0, 1),
(196, '2011-11-18 14:11:28', 1, 26, 3, 0, 1),
(197, '2011-11-18 14:11:28', 1, 26, 3, 0, 1),
(198, '2011-11-18 07:13:36', 1, 26, 3, 0, 1),
(199, '2011-11-21 08:55:16', 1, 156, 3, 0, 1),
(200, '2011-11-21 08:55:16', 1, 156, 3, 0, 1),
(201, '2011-11-21 04:29:34', 1, 156, 3, 0, 1),
(202, '2011-11-23 03:10:59', 4, 53, 3, 0, 1),
(203, '2011-11-23 03:12:01', 1, 119, 3, 0, 1),
(204, '2011-11-23 03:12:08', 1, 53, 3, 0, 1),
(205, '2011-11-23 03:14:56', 1, 53, 3, 0, 1),
(206, '2011-11-23 03:15:22', 1, 53, 3, 0, 1),
(207, '2011-11-23 03:15:51', 1, 53, 3, 0, 1),
(208, '2011-11-23 03:16:06', 1, 119, 3, 0, 1),
(209, '2011-11-23 03:17:08', 1, 119, 3, 0, 1),
(210, '2011-11-23 03:17:35', 1, 119, 3, 0, 1),
(211, '2011-11-23 03:18:59', 1, 156, 3, 0, 1),
(212, '2011-11-23 10:55:36', 1, 18, 3, 0, 1),
(213, '2011-11-23 03:55:39', 2, 18, 3, 0, 1),
(214, '2011-11-23 04:02:01', 2, 18, 3, 0, 1),
(215, '2011-11-23 04:05:47', 2, 18, 3, 0, 1),
(216, '2011-11-23 04:08:17', 1, 18, 3, 0, 1),
(217, '2011-11-23 04:08:37', 2, 18, 3, 0, 1),
(218, '2011-11-23 04:08:52', 2, 18, 3, 0, 1),
(219, '2011-11-23 04:09:52', 2, 18, 3, 0, 1),
(220, '2011-11-23 04:13:39', 2, 18, 3, 0, 1),
(221, '2011-11-23 04:14:21', 2, 18, 3, 0, 1),
(222, '2011-11-23 04:14:31', 2, 18, 3, 0, 1),
(223, '2011-11-23 04:22:05', 4, 42, 3, 0, 1),
(224, '2011-11-23 04:46:27', 4, 53, 3, 0, 1),
(225, '2011-11-23 15:23:39', 1, 151, 3, 0, 1),
(226, '2011-11-23 15:23:39', 1, 151, 3, 0, 1),
(227, '2011-11-23 15:23:39', 1, 151, 3, 0, 1),
(228, '2011-11-23 08:25:12', 1, 123, 3, 0, 1),
(229, '2011-11-23 08:25:26', 4, 123, 3, 0, 1),
(230, '2011-11-23 08:31:10', 1, 123, 3, 0, 1),
(231, '2011-11-23 08:31:36', 1, 98, 3, 0, 1),
(232, '2011-11-23 09:09:06', 1, 151, 3, 0, 1),
(233, '2011-11-24 02:17:23', 1, 53, 3, 0, 1),
(234, '2011-11-24 02:17:33', 2, 53, 3, 0, 1),
(235, '2011-11-24 03:24:49', 1, 123, 3, 0, 1),
(236, '2011-11-24 03:25:16', 4, 123, 3, 0, 1),
(237, '2011-11-24 06:51:53', 1, 54, 3, 0, 1),
(238, '2011-11-24 06:52:42', 1, 54, 3, 0, 1),
(239, '2011-11-25 04:29:04', 1, 167, 1, 1, 1),
(240, '2011-11-25 04:30:53', 1, 167, 1, 1, 1),
(241, '2011-11-25 04:31:48', 1, 167, 1, 1, 1),
(242, '2011-11-25 04:34:18', 1, 167, 1, 1, 1),
(243, '2011-11-25 04:34:23', 1, 167, 1, 1, 1),
(244, '2011-11-25 04:35:03', 1, 167, 1, 1, 1),
(245, '2011-11-25 04:40:48', 1, 168, 1, 1, 1),
(246, '2011-11-25 04:41:25', 1, 167, 1, 1, 1),
(247, '2011-11-25 04:44:12', 1, 167, 1, 1, 1),
(248, '2011-11-25 04:46:50', 1, 167, 1, 1, 1),
(249, '2011-11-25 04:48:19', 1, 167, 1, 1, 1),
(250, '2011-11-25 04:48:55', 1, 167, 1, 1, 1),
(251, '2011-11-25 04:59:14', 1, 167, 1, 1, 1),
(252, '2011-11-25 05:00:15', 1, 167, 1, 1, 1),
(253, '2011-11-25 06:55:38', 1, 168, 2, 1, 1),
(254, '2011-11-25 06:55:41', 1, 168, 2, 1, 1),
(255, '2011-11-25 06:56:17', 1, 167, 2, 1, 1),
(256, '2011-11-25 07:00:02', 1, 167, 2, 1, 1),
(257, '2011-11-25 07:00:13', 1, 168, 2, 1, 1),
(258, '2011-11-25 07:00:19', 1, 168, 2, 1, 1),
(259, '2011-11-25 07:04:52', 1, 168, 2, 1, 1),
(260, '2011-11-25 07:22:44', 1, 167, 56, 1, 1),
(261, '2011-11-25 07:36:03', 1, 168, 56, 1, 1),
(262, '2011-11-25 07:36:34', 1, 168, 56, 1, 1),
(263, '2011-11-25 07:38:31', 1, 167, 56, 1, 1),
(264, '2011-11-28 08:19:04', 1, 18, 5, 1, 1),
(265, '2012-08-06 05:00:53', 1, 16, 3, 1, 1),
(266, '2012-08-08 06:45:48', 1, 16, 17, 1, 1),
(267, '2012-08-08 07:01:53', 1, 167, 19, 1, 1),
(268, '2012-08-08 09:07:50', 1, 169, 27, 1, 1),
(269, '2012-08-08 09:16:21', 1, 169, 18, 1, 1),
(270, '2012-08-09 02:35:15', 1, 169, 32, 1, 1),
(271, '2012-08-09 02:44:28', 1, 170, 32, 1, 1),
(272, '2012-08-09 02:46:42', 1, 169, 32, 1, 1),
(273, '2012-08-09 02:46:45', 1, 180, 32, 1, 1),
(274, '2012-08-09 02:46:49', 1, 179, 32, 1, 1),
(275, '2012-08-09 02:46:53', 1, 178, 32, 1, 1),
(276, '2012-08-09 02:46:56', 1, 177, 32, 1, 1),
(277, '2012-08-09 02:47:00', 1, 176, 32, 1, 1),
(278, '2012-08-09 02:47:03', 1, 174, 32, 1, 1),
(279, '2012-08-09 02:47:07', 1, 173, 32, 1, 1),
(280, '2012-08-09 02:47:11', 1, 172, 32, 1, 1),
(281, '2012-08-09 02:47:15', 1, 171, 32, 1, 1),
(282, '2012-08-09 02:47:18', 1, 170, 32, 1, 1),
(283, '2012-08-09 02:47:21', 1, 181, 32, 1, 1),
(284, '2012-08-09 02:57:37', 1, 180, 32, 1, 1),
(285, '2012-08-09 02:57:40', 1, 177, 32, 1, 1),
(286, '2012-08-09 03:06:59', 1, 169, 32, 1, 1),
(287, '2012-08-09 04:26:00', 1, 180, 31, 1, 1),
(288, '2012-08-09 04:30:15', 1, 173, 36, 1, 1),
(289, '2012-08-09 14:57:33', 1, 180, 3, 0, 1),
(290, '2012-08-09 14:57:33', 1, 180, 3, 0, 1),
(291, '2012-08-09 14:57:33', 1, 180, 3, 0, 1),
(292, '2012-08-09 14:57:33', 1, 180, 3, 0, 1),
(293, '2012-08-09 14:57:33', 4, 173, 3, 0, 1),
(294, '2012-08-09 07:57:33', 4, 173, 3, 0, 1),
(295, '2012-08-09 16:21:25', 1, 180, 3, 0, 1),
(296, '2012-08-09 09:18:00', 1, 179, 3, 0, 1),
(297, '2012-08-09 09:22:26', 1, 179, 3, 0, 1),
(298, '2012-08-09 09:24:49', 1, 179, 3, 0, 1),
(299, '2012-08-09 09:46:18', 1, 179, 3, 0, 1),
(300, '2012-08-09 10:23:35', 1, 179, 3, 0, 1),
(301, '2012-08-09 10:24:21', 1, 179, 3, 0, 1),
(302, '2012-08-09 10:24:44', 1, 179, 3, 0, 1),
(303, '2012-08-09 10:29:58', 1, 179, 3, 0, 1),
(304, '2012-08-09 10:30:50', 1, 179, 3, 0, 1),
(305, '2012-08-10 02:08:59', 1, 171, 41, 1, 1),
(306, '2012-08-10 02:32:06', 1, 171, 41, 1, 1),
(307, '2012-08-10 02:33:42', 1, 171, 41, 1, 1),
(308, '2012-08-10 02:34:11', 1, 171, 41, 1, 1),
(309, '2012-08-10 02:57:02', 1, 170, 42, 1, 1),
(310, '2012-08-10 04:00:24', 4, 171, 3, 0, 1),
(311, '2012-08-10 06:23:56', 1, 171, 45, 1, 1),
(312, '2012-08-10 06:49:39', 1, 171, 46, 1, 1),
(313, '2012-08-10 06:49:58', 1, 171, 47, 1, 1),
(314, '2012-08-10 06:52:47', 1, 171, 47, 1, 1),
(315, '2012-08-10 07:02:21', 1, 171, 45, 1, 1),
(316, '2012-08-10 07:03:08', 1, 171, 47, 1, 1),
(317, '2012-08-10 07:15:38', 1, 171, 47, 1, 1),
(318, '2012-08-10 07:17:38', 1, 171, 47, 1, 1),
(319, '2012-08-10 07:18:14', 1, 171, 47, 1, 1),
(320, '2012-08-10 07:18:36', 1, 171, 47, 1, 1),
(321, '2012-08-10 07:18:45', 1, 171, 47, 1, 1),
(322, '2012-08-10 07:26:46', 1, 171, 47, 1, 1),
(323, '2012-08-10 07:26:55', 1, 171, 47, 1, 1),
(324, '2012-08-10 07:35:03', 1, 171, 47, 1, 1),
(325, '2012-08-10 07:41:06', 1, 171, 47, 1, 1),
(326, '2012-08-10 07:41:26', 1, 171, 47, 1, 1),
(327, '2012-08-10 07:41:44', 1, 171, 47, 1, 1),
(328, '2012-08-10 07:42:58', 1, 171, 45, 1, 1),
(329, '2012-08-10 10:19:28', 1, 170, 3, 0, 1),
(330, '2012-08-13 01:48:16', 1, 173, 50, 1, 1),
(331, '2012-08-13 01:57:25', 1, 173, 50, 1, 1),
(332, '2012-08-13 02:10:21', 1, 173, 50, 1, 1),
(333, '2012-08-13 02:14:52', 1, 173, 50, 1, 1),
(334, '2012-08-13 02:15:13', 1, 173, 50, 1, 1),
(335, '2012-08-13 02:15:21', 1, 173, 50, 1, 1),
(336, '2012-08-13 02:15:40', 1, 173, 50, 1, 1),
(337, '2012-08-13 02:17:49', 1, 173, 50, 1, 1),
(338, '2012-08-13 02:18:29', 1, 173, 50, 1, 1),
(339, '2012-08-13 02:19:30', 1, 173, 50, 1, 1),
(340, '2012-08-13 02:21:41', 1, 173, 50, 1, 1),
(341, '2012-08-13 02:22:05', 1, 173, 50, 1, 1),
(342, '2012-08-13 02:22:14', 1, 173, 50, 1, 1),
(343, '2012-08-13 02:22:55', 1, 173, 50, 1, 1),
(344, '2012-08-13 02:23:09', 1, 173, 50, 1, 1),
(345, '2012-08-13 02:23:48', 1, 173, 50, 1, 1),
(346, '2012-08-13 02:24:05', 1, 173, 50, 1, 1),
(347, '2012-08-13 02:24:52', 1, 173, 50, 1, 1),
(348, '2012-08-13 02:25:41', 1, 173, 50, 1, 1),
(349, '2012-08-13 02:26:26', 1, 173, 50, 1, 1),
(350, '2012-08-13 02:26:52', 1, 173, 50, 1, 1),
(351, '2012-08-13 02:28:06', 1, 173, 50, 1, 1),
(352, '2012-08-13 02:28:36', 1, 173, 50, 1, 1),
(353, '2012-08-13 02:29:52', 1, 173, 50, 1, 1),
(354, '2012-08-13 02:30:43', 1, 173, 50, 1, 1),
(355, '2012-08-13 02:31:41', 1, 173, 50, 1, 1),
(356, '2012-08-13 02:32:29', 1, 173, 50, 1, 1),
(357, '2012-08-13 02:55:43', 1, 173, 50, 1, 1),
(358, '2012-08-13 02:57:04', 1, 173, 50, 1, 1),
(359, '2012-08-13 02:57:19', 1, 173, 50, 1, 1),
(360, '2012-08-13 02:59:49', 1, 173, 50, 1, 1),
(361, '2012-08-13 03:00:33', 1, 173, 50, 1, 1),
(362, '2012-08-13 03:00:50', 1, 173, 50, 1, 1),
(363, '2012-08-13 03:01:04', 1, 173, 50, 1, 1),
(364, '2012-08-13 03:05:02', 1, 173, 50, 1, 1),
(365, '2012-08-13 03:06:07', 1, 173, 50, 1, 1),
(366, '2012-08-13 03:06:25', 1, 173, 50, 1, 1),
(367, '2012-08-13 03:07:35', 1, 173, 50, 1, 1),
(368, '2012-08-13 03:07:46', 1, 173, 50, 1, 1),
(369, '2012-08-13 03:08:30', 1, 173, 50, 1, 1),
(370, '2012-08-13 03:08:52', 1, 173, 50, 1, 1),
(371, '2012-08-13 03:09:30', 1, 173, 50, 1, 1),
(372, '2012-08-13 03:29:11', 1, 173, 50, 1, 1),
(373, '2012-08-13 03:30:28', 1, 173, 50, 1, 1),
(374, '2012-08-13 03:37:01', 1, 173, 50, 1, 1),
(375, '2012-08-13 03:37:39', 1, 173, 50, 1, 1),
(376, '2012-08-13 03:39:14', 1, 173, 50, 1, 1),
(377, '2012-08-13 03:39:49', 1, 173, 50, 1, 1),
(378, '2012-08-13 03:41:40', 1, 173, 50, 1, 1),
(379, '2012-08-13 03:55:57', 1, 173, 50, 1, 1),
(380, '2012-08-13 03:59:55', 1, 173, 50, 1, 1),
(381, '2012-08-13 04:02:30', 1, 173, 50, 1, 1),
(382, '2012-08-13 04:04:45', 1, 173, 50, 1, 1),
(383, '2012-08-13 04:05:42', 1, 173, 50, 1, 1),
(384, '2012-08-13 04:06:08', 1, 173, 50, 1, 1),
(385, '2012-08-13 04:07:40', 1, 173, 50, 1, 1),
(386, '2012-08-13 04:29:31', 1, 173, 50, 1, 1),
(387, '2012-08-13 04:30:11', 1, 173, 50, 1, 1),
(388, '2012-08-13 04:31:18', 1, 173, 50, 1, 1),
(389, '2012-08-13 04:34:38', 1, 173, 50, 1, 1),
(390, '2012-08-13 04:35:11', 1, 173, 50, 1, 1),
(391, '2012-08-13 04:36:31', 1, 173, 50, 1, 1),
(392, '2012-08-13 04:38:21', 1, 173, 50, 1, 1),
(393, '2012-08-13 04:40:24', 1, 173, 50, 1, 1),
(394, '2012-08-13 04:42:10', 1, 173, 50, 1, 1),
(395, '2012-08-13 04:43:04', 1, 173, 50, 1, 1),
(396, '2012-08-13 04:43:25', 1, 173, 50, 1, 1),
(397, '2012-08-13 04:43:41', 1, 173, 50, 1, 1),
(398, '2012-08-13 04:44:09', 1, 173, 50, 1, 1),
(399, '2012-08-13 04:44:21', 1, 173, 50, 1, 1),
(400, '2012-08-13 04:47:02', 1, 173, 50, 1, 1),
(401, '2012-08-13 04:47:19', 1, 173, 50, 1, 1),
(402, '2012-08-13 04:48:21', 1, 173, 50, 1, 1),
(403, '2012-08-13 04:49:16', 1, 179, 50, 1, 1),
(404, '2012-08-13 05:26:09', 4, 170, 61, 1, 1),
(405, '2012-08-13 13:53:20', 1, 179, 3, 0, 1),
(406, '2012-08-13 13:53:20', 1, 179, 3, 0, 1),
(407, '2012-08-13 13:53:20', 1, 179, 3, 0, 1),
(408, '2012-08-13 13:53:20', 1, 179, 3, 0, 1),
(409, '2012-08-13 07:54:06', 4, 173, 73, 1, 1),
(410, '2012-08-13 09:16:57', 1, 173, 74, 1, 1),
(411, '2012-08-14 04:59:58', 4, 173, 75, 1, 1),
(412, '2012-08-14 07:20:04', 1, 173, 3, 0, 1),
(413, '2012-08-14 07:38:34', 1, 173, 3, 0, 1),
(414, '2012-08-15 03:29:50', 1, 178, 83, 1, 1),
(415, '2012-08-15 03:36:40', 4, 178, 83, 1, 1),
(416, '2012-08-15 08:26:53', 1, 173, 3, 0, 1),
(417, '2012-08-15 10:10:24', 1, 180, 96, 1, 1),
(418, '2012-08-15 10:11:29', 1, 180, 96, 1, 1),
(419, '2012-08-15 10:11:38', 4, 180, 96, 1, 1),
(420, '2012-08-16 10:25:47', 4, 171, 3, 0, 1),
(421, '2012-08-16 10:25:47', 1, 179, 3, 0, 1),
(422, '2012-08-16 04:32:02', 3, 179, 3, 0, 1),
(423, '2012-08-16 04:56:08', 3, 180, 3, 0, 1),
(424, '2012-08-16 07:31:21', 5, 180, 3, 0, 1),
(425, '2012-08-16 10:12:15', 1, 171, 3, 0, 1),
(426, '2012-08-17 04:24:15', 1, 169, 108, 1, 1),
(427, '2012-08-17 04:31:09', 1, 169, 108, 1, 1),
(428, '2012-08-17 04:32:06', 1, 169, 108, 1, 1),
(429, '2012-08-17 04:42:54', 1, 169, 108, 1, 1),
(430, '2012-08-17 04:47:50', 1, 169, 108, 1, 1),
(431, '2012-08-17 04:48:53', 1, 169, 108, 1, 1),
(432, '2012-08-17 04:49:57', 1, 169, 108, 1, 1),
(433, '2012-08-17 04:50:42', 1, 169, 108, 1, 1),
(434, '2012-08-17 04:56:18', 1, 169, 108, 1, 1),
(435, '2012-08-17 04:59:15', 1, 169, 108, 1, 1),
(436, '2012-08-17 06:54:15', 1, 169, 109, 1, 1),
(437, '2012-08-17 15:13:51', 1, 169, 3, 0, 1),
(438, '2012-08-17 15:13:51', 1, 169, 3, 0, 1),
(439, '2012-08-17 15:13:51', 3, 169, 3, 0, 1),
(440, '2012-08-17 15:13:51', 1, 169, 3, 0, 1),
(441, '2012-08-17 15:13:51', 1, 169, 3, 0, 1),
(442, '2012-08-17 15:13:51', 1, 169, 3, 0, 1),
(443, '2012-08-17 15:13:51', 1, 169, 3, 0, 1),
(444, '2012-08-17 15:13:51', 1, 169, 3, 0, 1),
(445, '2012-08-17 15:13:51', 1, 169, 3, 0, 1),
(446, '2012-08-17 15:13:51', 1, 169, 3, 0, 1),
(447, '2012-08-17 07:24:02', 1, 169, 112, 1, 1),
(448, '2012-08-17 15:13:51', 1, 172, 3, 0, 1),
(449, '2012-08-17 15:13:51', 1, 172, 3, 0, 1),
(450, '2012-08-17 10:37:06', 1, 170, 117, 1, 1),
(451, '2012-08-20 01:40:43', 1, 170, 119, 1, 1),
(452, '2012-08-20 09:11:18', 1, 172, 3, 0, 1),
(453, '2012-08-20 09:11:18', 1, 172, 3, 0, 1),
(454, '2012-08-20 09:11:18', 1, 172, 3, 0, 1),
(455, '2012-08-20 09:04:33', 1, 169, 3, 0, 1),
(456, '2012-08-20 09:04:33', 1, 169, 3, 0, 1),
(457, '2012-08-20 07:17:03', 4, 171, 128, 1, 1),
(458, '2012-08-20 07:39:09', 1, 169, 133, 1, 1),
(459, '2012-08-20 07:42:31', 4, 169, 132, 1, 1),
(460, '2012-08-20 07:44:09', 4, 171, 133, 1, 1),
(461, '2012-08-20 07:55:51', 1, 171, 132, 1, 1),
(462, '2012-08-20 08:40:39', 1, 173, 138, 1, 1),
(463, '2012-08-20 09:30:52', 1, 173, 138, 1, 1),
(464, '2012-08-20 17:12:42', 1, 173, 3, 0, 1),
(465, '2012-08-20 09:34:22', 1, 173, 138, 1, 1),
(466, '2012-08-20 17:12:42', 1, 173, 3, 0, 1),
(467, '2012-08-20 09:34:54', 1, 173, 138, 1, 1),
(468, '2012-08-20 09:36:09', 5, 180, 3, 0, 1),
(469, '2012-08-20 10:19:06', 1, 180, 3, 0, 1),
(470, '2012-08-21 04:32:27', 1, 169, 150, 1, 1),
(471, '2012-08-22 03:30:12', 4, 179, 3, 0, 1),
(472, '2012-08-22 08:14:33', 1, 171, 161, 1, 1),
(473, '2012-08-23 02:38:41', 1, 177, 3, 0, 1),
(474, '2012-08-23 02:39:51', 1, 177, 3, 0, 1),
(475, '2012-08-23 02:40:31', 1, 177, 3, 0, 1),
(476, '2012-08-23 02:40:59', 1, 177, 3, 0, 1),
(477, '2012-08-23 02:42:10', 1, 177, 3, 0, 1),
(478, '2012-08-23 02:42:51', 1, 177, 3, 0, 1),
(479, '2012-08-23 02:42:55', 1, 177, 3, 0, 1),
(480, '2012-08-23 02:43:59', 1, 177, 3, 0, 1),
(481, '2012-08-23 02:53:00', 1, 177, 3, 0, 1),
(482, '2012-08-23 02:58:59', 3, 173, 3, 0, 1),
(483, '2012-08-23 03:00:15', 3, 171, 3, 0, 1),
(484, '2012-08-23 03:02:04', 1, 170, 3, 0, 1),
(485, '2012-08-23 03:02:23', 1, 170, 3, 0, 1),
(486, '2012-08-23 03:02:41', 3, 173, 3, 0, 1),
(487, '2012-08-23 03:02:50', 1, 173, 3, 0, 1),
(488, '2012-08-23 03:27:32', 1, 173, 3, 0, 1),
(489, '2012-08-23 03:27:44', 2, 173, 3, 0, 1),
(490, '2012-08-23 03:48:39', 1, 173, 3, 0, 1),
(491, '2012-08-23 03:51:34', 1, 173, 3, 0, 1),
(492, '2012-08-23 03:52:24', 1, 173, 3, 0, 1),
(493, '2012-08-23 03:54:10', 1, 173, 3, 0, 1),
(494, '2012-08-23 03:54:26', 4, 173, 3, 0, 1),
(495, '2012-08-23 03:54:33', 5, 173, 3, 0, 1),
(496, '2012-08-23 04:08:29', 1, 171, 3, 0, 1),
(497, '2012-08-23 04:11:10', 1, 171, 3, 0, 1),
(498, '2012-08-23 04:11:27', 1, 171, 3, 0, 1),
(499, '2012-08-23 04:11:46', 1, 171, 3, 0, 1),
(500, '2012-08-23 04:12:19', 1, 171, 3, 0, 1),
(501, '2012-08-23 04:12:45', 1, 171, 3, 0, 1),
(502, '2012-08-23 04:13:56', 1, 171, 3, 0, 1),
(503, '2012-08-23 04:14:52', 1, 171, 3, 0, 1),
(504, '2012-08-23 04:17:20', 1, 171, 3, 0, 1),
(505, '2012-08-23 04:17:53', 1, 171, 3, 0, 1),
(506, '2012-08-23 14:48:48', 1, 171, 3, 0, 1),
(507, '2012-08-23 14:48:48', 1, 171, 3, 0, 1),
(508, '2012-08-23 14:48:48', 1, 171, 3, 0, 1),
(509, '2012-08-23 14:48:02', 1, 169, 3, 0, 1),
(510, '2012-08-23 14:48:02', 1, 173, 3, 0, 1),
(511, '2012-08-23 14:48:02', 1, 171, 3, 0, 1),
(512, '2012-08-23 14:48:48', 1, 170, 3, 0, 1),
(513, '2012-08-23 14:48:02', 1, 171, 3, 0, 1),
(514, '2012-08-23 14:48:02', 1, 171, 3, 0, 1),
(515, '2012-08-23 14:48:02', 1, 171, 3, 0, 1),
(516, '2012-08-23 08:43:40', 1, 169, 170, 1, 1),
(517, '2012-08-23 08:47:05', 1, 169, 3, 0, 1),
(518, '2012-08-23 08:47:48', 1, 169, 3, 0, 1),
(519, '2012-08-23 09:12:57', 1, 173, 3, 0, 1),
(520, '2012-08-23 09:13:16', 1, 179, 3, 0, 1),
(521, '2012-08-23 10:02:51', 1, 169, 170, 1, 1),
(522, '2012-08-24 10:28:31', 4, 169, 3, 0, 1),
(523, '2012-08-24 02:12:12', 4, 171, 173, 1, 1),
(524, '2012-08-24 03:07:10', 1, 169, 179, 1, 1),
(525, '2012-08-24 03:11:36', 4, 169, 179, 1, 1),
(526, '2012-08-24 03:28:31', 4, 169, 3, 0, 1),
(527, '2012-08-24 04:14:14', 3, 169, 3, 0, 1),
(528, '2012-08-24 04:14:59', 3, 171, 3, 0, 1),
(529, '2012-08-24 04:16:53', 3, 180, 3, 0, 1),
(530, '2012-08-24 04:26:41', 4, 180, 3, 0, 1),
(531, '2012-08-24 08:54:02', 4, 169, 194, 1, 1),
(532, '2012-08-25 03:55:55', 1, 171, 198, 1, 1),
(533, '2012-08-25 04:03:26', 4, 171, 198, 1, 1),
(534, '2012-08-25 04:06:18', 1, 173, 199, 1, 1),
(535, '2012-08-25 04:06:34', 4, 173, 199, 1, 1),
(536, '2012-08-25 14:04:19', 1, 172, 3, 0, 1),
(537, '2012-08-25 14:04:19', 1, 172, 3, 0, 1),
(538, '2015-04-24 08:03:30', 1, 170, 1, 1, 1),
(539, '2015-04-24 08:28:27', 1, 170, 1, 1, 1),
(540, '2015-04-24 08:32:30', 1, 180, 1, 1, 1),
(541, '2015-04-24 09:50:21', 1, 182, 4, 1, 1);

CREATE TABLE `#__report_event_types` (
  `event_type_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Event Type Id',
  `event_name` varchar(64) NOT NULL COMMENT 'Event Name',
  `customer_login` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Login',
  PRIMARY KEY (`event_type_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Reports Event Type Table';

INSERT INTO `#__report_event_types` (`event_type_id`, `event_name`, `customer_login`) VALUES
(1, 'catalog_product_view', 1),
(2, 'sendfriend_product', 1),
(3, 'catalog_product_compare_add_product', 1),
(4, 'checkout_cart_add_product', 1),
(5, 'wishlist_add_product', 1),
(6, 'wishlist_share', 1);

CREATE TABLE `#__report_viewed_product_aggregated_daily` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `product_id` int(10) unsigned DEFAULT NULL COMMENT 'Product Id',
  `product_name` varchar(255) DEFAULT NULL COMMENT 'Product Name',
  `product_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Product Price',
  `views_num` int(11) NOT NULL DEFAULT '0' COMMENT 'Number of Views',
  `rating_pos` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Pos',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_REPORT_VIEWED_PRD_AGGRED_DAILY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  KEY `IDX_REPORT_VIEWED_PRODUCT_AGGREGATED_DAILY_STORE_ID` (`store_id`),
  KEY `IDX_REPORT_VIEWED_PRODUCT_AGGREGATED_DAILY_PRODUCT_ID` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Most Viewed Products Aggregated Daily';


CREATE TABLE `#__report_viewed_product_aggregated_monthly` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `product_id` int(10) unsigned DEFAULT NULL COMMENT 'Product Id',
  `product_name` varchar(255) DEFAULT NULL COMMENT 'Product Name',
  `product_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Product Price',
  `views_num` int(11) NOT NULL DEFAULT '0' COMMENT 'Number of Views',
  `rating_pos` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Pos',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_REPORT_VIEWED_PRD_AGGRED_MONTHLY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  KEY `IDX_REPORT_VIEWED_PRODUCT_AGGREGATED_MONTHLY_STORE_ID` (`store_id`),
  KEY `IDX_REPORT_VIEWED_PRODUCT_AGGREGATED_MONTHLY_PRODUCT_ID` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Most Viewed Products Aggregated Monthly';


CREATE TABLE `#__report_viewed_product_aggregated_yearly` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `product_id` int(10) unsigned DEFAULT NULL COMMENT 'Product Id',
  `product_name` varchar(255) DEFAULT NULL COMMENT 'Product Name',
  `product_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Product Price',
  `views_num` int(11) NOT NULL DEFAULT '0' COMMENT 'Number of Views',
  `rating_pos` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Rating Pos',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_REPORT_VIEWED_PRD_AGGRED_YEARLY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  KEY `IDX_REPORT_VIEWED_PRODUCT_AGGREGATED_YEARLY_STORE_ID` (`store_id`),
  KEY `IDX_REPORT_VIEWED_PRODUCT_AGGREGATED_YEARLY_PRODUCT_ID` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Most Viewed Products Aggregated Yearly';


CREATE TABLE `#__report_viewed_product_index` (
  `index_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Index Id',
  `visitor_id` int(10) unsigned DEFAULT NULL COMMENT 'Visitor Id',
  `customer_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer Id',
  `product_id` int(10) unsigned NOT NULL COMMENT 'Product Id',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `added_at` timestamp NOT NULL COMMENT 'Added At',
  PRIMARY KEY (`index_id`),
  UNIQUE KEY `UNQ_REPORT_VIEWED_PRODUCT_INDEX_VISITOR_ID_PRODUCT_ID` (`visitor_id`,`product_id`),
  UNIQUE KEY `UNQ_REPORT_VIEWED_PRODUCT_INDEX_CUSTOMER_ID_PRODUCT_ID` (`customer_id`,`product_id`),
  KEY `IDX_REPORT_VIEWED_PRODUCT_INDEX_STORE_ID` (`store_id`),
  KEY `IDX_REPORT_VIEWED_PRODUCT_INDEX_ADDED_AT` (`added_at`),
  KEY `IDX_REPORT_VIEWED_PRODUCT_INDEX_PRODUCT_ID` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Reports Viewed Product Index Table';

INSERT INTO `#__report_viewed_product_index` (`index_id`, `visitor_id`, `customer_id`, `product_id`, `store_id`, `added_at`) VALUES
(121, 27, NULL, 169, 1, '2012-08-08 09:07:50'),
(122, 18, NULL, 169, 1, '2012-08-08 09:16:21'),
(123, 32, NULL, 169, 1, '2012-08-09 03:06:59'),
(124, 32, NULL, 170, 1, '2012-08-09 02:47:18'),
(126, 32, NULL, 180, 1, '2012-08-09 02:57:37'),
(127, 32, NULL, 179, 1, '2012-08-09 02:46:49'),
(128, 32, NULL, 178, 1, '2012-08-09 02:46:53'),
(129, 32, NULL, 177, 1, '2012-08-09 02:57:40'),
(130, 32, NULL, 176, 1, '2012-08-09 02:47:00'),
(131, 32, NULL, 174, 1, '2012-08-09 02:47:03'),
(132, 32, NULL, 173, 1, '2012-08-09 02:47:07'),
(133, 32, NULL, 172, 1, '2012-08-09 02:47:11'),
(134, 32, NULL, 171, 1, '2012-08-09 02:47:14'),
(136, 32, NULL, 181, 1, '2012-08-09 02:47:21'),
(140, 31, NULL, 180, 1, '2012-08-09 04:26:00'),
(141, 36, NULL, 173, 1, '2012-08-09 04:30:15'),
(142, 135, 3, 180, 1, '2012-08-20 10:19:05'),
(147, 166, 3, 179, 1, '2012-08-23 09:13:16'),
(148, 41, NULL, 171, 1, '2012-08-10 02:34:11'),
(152, 42, NULL, 170, 1, '2012-08-10 02:57:01'),
(153, 45, NULL, 171, 1, '2012-08-10 07:42:58'),
(154, 46, NULL, 171, 1, '2012-08-10 06:49:39'),
(155, 47, NULL, 171, 1, '2012-08-10 07:41:44'),
(171, 166, 3, 170, 1, '2012-08-23 07:48:49'),
(172, 50, NULL, 173, 1, '2012-08-13 04:48:21'),
(245, 50, NULL, 179, 1, '2012-08-13 04:49:16'),
(250, 74, NULL, 173, 1, '2012-08-13 09:16:56'),
(251, 166, 3, 173, 1, '2012-08-23 09:12:57'),
(252, 83, NULL, 178, 1, '2012-08-15 03:29:49'),
(254, 96, NULL, 180, 1, '2012-08-15 10:11:29'),
(256, 166, 3, 171, 1, '2012-08-23 07:48:49'),
(257, 108, NULL, 169, 1, '2012-08-17 04:59:15'),
(258, 109, NULL, 169, 1, '2012-08-17 06:54:14'),
(259, 166, 3, 169, 1, '2012-08-23 08:47:47'),
(268, 112, NULL, 169, 1, '2012-08-17 07:24:02'),
(269, 201, 3, 172, 1, '2012-08-25 07:04:19'),
(271, 117, NULL, 170, 1, '2012-08-17 10:37:05'),
(272, 119, NULL, 170, 1, '2012-08-20 01:40:43'),
(278, 133, NULL, 169, 1, '2012-08-20 07:39:09'),
(279, 132, NULL, 171, 1, '2012-08-20 07:55:51'),
(280, 138, NULL, 173, 1, '2012-08-20 09:34:53'),
(281, 150, NULL, 169, 1, '2012-08-21 04:32:26'),
(282, 161, NULL, 171, 1, '2012-08-22 08:14:32'),
(283, 164, 3, 177, 1, '2012-08-23 02:53:00'),
(294, 170, NULL, 169, 1, '2012-08-23 10:02:50'),
(295, 179, NULL, 169, 1, '2012-08-24 03:07:09'),
(296, 198, NULL, 171, 1, '2012-08-25 03:55:53'),
(297, 199, NULL, 173, 1, '2012-08-25 04:06:18'),
(298, 1, NULL, 170, 1, '2015-04-24 08:28:26'),
(300, 1, NULL, 180, 1, '2015-04-24 08:32:30'),
(301, 4, NULL, 182, 1, '2015-04-24 09:50:20');

CREATE TABLE `#__review` (
  `review_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Review id',
  `created_at` timestamp NOT NULL COMMENT 'Review create date',
  `entity_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Entity id',
  `entity_pk_value` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Product id',
  `status_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Status code',
  PRIMARY KEY (`review_id`),
  KEY `IDX_REVIEW_ENTITY_ID` (`entity_id`),
  KEY `IDX_REVIEW_STATUS_ID` (`status_id`),
  KEY `IDX_REVIEW_ENTITY_PK_VALUE` (`entity_pk_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Review base information';

INSERT INTO `#__review` (`review_id`, `created_at`, `entity_id`, `entity_pk_value`, `status_id`) VALUES
(1, '2012-08-09 02:54:43', 1, 169, 1),
(2, '2012-08-09 02:56:00', 1, 179, 1),
(3, '2012-08-09 02:56:06', 1, 178, 1),
(4, '2012-08-09 02:56:16', 1, 176, 1),
(5, '2012-08-09 02:56:22', 1, 174, 1),
(6, '2012-08-09 02:56:28', 1, 173, 1),
(7, '2012-08-09 02:56:30', 1, 172, 1),
(8, '2012-08-09 02:56:35', 1, 171, 1),
(9, '2012-08-09 02:56:42', 1, 170, 1),
(10, '2012-08-09 02:56:48', 1, 181, 1),
(11, '2012-08-09 02:58:28', 1, 177, 1),
(12, '2012-08-09 02:58:36', 1, 180, 1),
(13, '2012-08-14 08:02:24', 1, 173, 1);

CREATE TABLE `#__review_detail` (
  `detail_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Review detail id',
  `review_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Review id',
  `store_id` smallint(5) unsigned DEFAULT '0' COMMENT 'Store id',
  `title` varchar(255) NOT NULL COMMENT 'Title',
  `detail` text NOT NULL COMMENT 'Detail description',
  `nickname` varchar(128) NOT NULL COMMENT 'User nickname',
  `customer_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer Id',
  PRIMARY KEY (`detail_id`),
  KEY `j502fa_FK_FK_REVIEW_DETAIL_CUSTOMER` (`customer_id`),
  KEY `IDX_REVIEW_DETAIL_REVIEW_ID` (`review_id`),
  KEY `IDX_REVIEW_DETAIL_STORE_ID` (`store_id`),
  KEY `IDX_REVIEW_DETAIL_CUSTOMER_ID` (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Review detail information';

INSERT INTO `#__review_detail` (`detail_id`, `review_id`, `store_id`, `title`, `detail`, `nickname`, `customer_id`) VALUES
(1, 1, 1, 'Mauris faucibus tortor vitae justo viverra ultrices.', 'Nulla placerat, magna ac suscipit placerat, elit enim interdum neque, non gravida lorem sapien a arcu. Morbi ac velit id arcu rutrum cursus sed sit amet tortor.', 'Kevin', NULL),
(2, 2, 1, 'Donec suscipit leo et tortor euismod nec feugiat est ultrices. ', 'Sed varius semper dapibus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nullam non nibh sed metus hendrerit iaculis at sit amet arcu. Proin lacus urna, ullamcorper vitae hendrerit rhoncus, vehicula eu magna. Curabitur ac dolor dui. Morbi accumsan vehicula nibh, sed cursus elit vehicula eu. Vestibulum tristique mi et diam cursus dapibus. Maecenas a arcu id eros placerat porttitor. Nulla placerat, magna ac suscipit placerat, elit enim interdum neque, non gravida lorem sapien a arcu. Morbi ac velit id arcu rutrum cursus sed sit amet tortor.', 'Katherine', NULL),
(3, 3, 1, 'Mauris purus nisi, tincidunt sit amet rhoncus in.', ' Cras erat risus, adipiscing id suscipit luctus, pharetra vel metus. Nulla porttitor sollicitudin turpis, a ultricies sem lobortis in. Nulla semper purus sit amet odio euismod vel fermentum magna euismod. Nullam lectus felis, volutpat nec pharetra condimentum, facilisis eu neque.', 'Victoria', NULL),
(4, 4, 1, 'Nam a nulla sit amet ligula facilisis feugiat. Nullam laoreet, purus vel cursus ultrices.', 'Etiam dolor ante, rhoncus ac pretium a, rutrum vel leo. Nulla et arcu id ligula scelerisque tempus ultricies sed urna. Morbi mattis, elit sed convallis volutpat, risus sem malesuada est, eu sodales eros mauris in lacus. Ut eu nisl felis, sit amet consectetur nibh. In at eleifend purus. Morbi id sapien et urna luctus mattis mollis vitae tortor. Nullam vestibulum, ipsum at feugiat posuere, velit libero placerat est, nec sodales diam nunc non est. Phasellus eget vulputate est.', 'Elijah', NULL),
(5, 5, 1, 'Ut vehicula nisl quis lacus scelerisque at congue dolor tincidunt. Ut orci est, cursus eu suscipit at, pretium in mi.', 'Nullam pellentesque faucibus mi, nec fringilla tellus luctus vitae. In ut urna erat, a bibendum ligula. Praesent molestie dignissim nisi sed ultricies. Pellentesque felis purus, tincidunt scelerisque accumsan eu, bibendum ac nibh. Nam eget risus felis. Mauris condimentum magna at eros molestie non bibendum nulla gravida. Etiam vehicula nunc ut magna facilisis hendrerit. Phasellus ut lectus magna, vel ultrices erat.', 'Stephanie', NULL),
(6, 6, 1, 'Morbi et lacus nibh, ut aliquam elit. Nullam in neque nisl.', 'Pellentesque sem massa, lacinia sit amet varius quis, placerat et tortor. Fusce semper viverra dui, ac porttitor dolor tincidunt sit amet. Cras semper odio blandit justo egestas sit amet dignissim eros feugiat. Cras tristique velit eu felis eleifend vestibulum. Integer id mi odio, eget ultricies nisi. Donec blandit ante ut massa pretium ut rutrum lorem suscipit. Nullam ullamcorper elementum consequat. N', 'Sophia', NULL),
(7, 7, 1, 'Nulla elit dui, elementum at faucibus ut, rutrum nec nibh.', 'Curabitur eget sapien velit, id volutpat urna. Proin convallis, justo ut molestie mollis, quam urna fringilla turpis, ac accumsan ligula lorem in est. Curabitur in nunc nibh. Duis in aliquam turpis. Aenean ac mauris nec est dapibus porttitor. Pellentesque euismod quam at ligula consectetur quis luctus ligula semper. Aenean vitae dui at est mattis bibendum. Ut nec lectus ut neque blandit tempus. Duis eu risus erat. In ultricies, risus sit amet volutpat sollicitudin, enim massa porttitor nisi, et vulputate quam libero a ipsum. Nullam eros est, euismod vitae sollicitudin ut, dignissim sit amet purus. Nullam consequat elit at urna tincidunt ac sodales est vehicula. Proin suscipit aliquam feugiat. Vivamus ac neque quis ligula vulputate porttitor.', 'Samuel', NULL),
(8, 8, 1, ' Nulla semper purus sit amet odio euismod vel fermentum magna euismod.', 'Aenean dolor dui, cursus a porttitor quis, accumsan a lectus. Quisque libero orci, malesuada eu mattis id, rutrum at mauris. Suspendisse at facilisis arcu. Aliquam rhoncus, velit vel dictum interdum, sem justo feugiat eros, eu viverra orci felis in leo. Sed fermentum aliquam mi, in dapibus orci molestie at.', 'Megan', NULL),
(9, 9, 1, 'Duis ante felis, congue et sagittis eu, suscipit elementum lorem.', 'Fusce feugiat cursus erat non dapibus. In sed orci a eros dapibus malesuada lacinia vitae enim. Curabitur purus felis, fringilla et ultricies eu, feugiat sit amet tellus. Donec arcu justo, vestibulum sit amet suscipit eget, mollis non dui. Donec posuere vehicula tempor. Maecenas adipiscing velit id sapien facilisis nec faucibus lorem facilisis. Proin adipiscing urna lacus, nec tristique erat. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos.', 'Mackenzie', NULL),
(10, 10, 1, 'Cras euismod felis auctor elit auctor iaculis. ', 'Fusce convallis egestas erat, non dapibus quam tincidunt ac. Phasellus diam nunc, rutrum non blandit at, dapibus ut odio. Sed quis augue mi. Pellentesque sed risus et arcu malesuada auctor. Ut viverra ornare ullamcorper. Nam nec tellus diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer id nunc eu tellus facilisis congue. Aenean vel convallis metus. Curabitur elementum urna eu nisi elementum sit amet facilisis orci molestie.', 'Aaron', NULL),
(11, 11, 1, 'Donec hendrerit magna eu ante cursus tristique. ', 'Proin ultrices leo non diam eleifend in posuere lorem aliquam. In sed cursus turpis. Vestibulum convallis bibendum purus sit amet egestas. Donec sed convallis ligula. Donec molestie, elit eu lobortis elementum, quam justo elementum nunc, at pulvinar lectus massa a mauris. ', 'Nicole', NULL),
(12, 12, 1, 'Duis volutpat sem justo, ut molestie ligula. Nulla facilisi.', 'Fusce convallis egestas erat, non dapibus quam tincidunt ac. Phasellus diam nunc, rutrum non blandit at, dapibus ut odio. Sed quis augue mi. Pellentesque sed risus et arcu malesuada auctor. Ut viverra ornare ullamcorper. Nam nec tellus diam. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Integer id nunc eu tellus facilisis congue. Aenean vel convallis metus. Curabitur elementum urna eu nisi elementum sit amet facilisis orci molestie.', 'Maria', NULL),
(13, 13, 1, 'Success with offshore Scrum teams', 'There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don''t look even slightly believable. If you are going to use a passage of Lorem Ipsum. ', 'Joom', 3);

CREATE TABLE `#__review_entity` (
  `entity_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Review entity id',
  `entity_code` varchar(32) NOT NULL COMMENT 'Review entity code',
  PRIMARY KEY (`entity_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Review entities';

INSERT INTO `#__review_entity` (`entity_id`, `entity_code`) VALUES
(1, 'product'),
(2, 'customer'),
(3, 'category');

CREATE TABLE `#__review_entity_summary` (
  `primary_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Summary review entity id',
  `entity_pk_value` bigint(20) NOT NULL DEFAULT '0' COMMENT 'Product id',
  `entity_type` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Entity type id',
  `reviews_count` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Qty of reviews',
  `rating_summary` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Summarized rating',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store id',
  PRIMARY KEY (`primary_id`),
  KEY `IDX_REVIEW_ENTITY_SUMMARY_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Review aggregates';

INSERT INTO `#__review_entity_summary` (`primary_id`, `entity_pk_value`, `entity_type`, `reviews_count`, `rating_summary`, `store_id`) VALUES
(1, 169, 1, 1, 93, 1),
(2, 169, 1, 0, 0, 3),
(3, 169, 1, 0, 0, 2),
(4, 179, 1, 1, 67, 1),
(5, 179, 1, 0, 0, 3),
(6, 179, 1, 0, 0, 2),
(7, 178, 1, 1, 80, 1),
(8, 178, 1, 0, 0, 3),
(9, 178, 1, 0, 0, 2),
(10, 176, 1, 1, 87, 1),
(11, 176, 1, 0, 0, 3),
(12, 176, 1, 0, 0, 2),
(13, 174, 1, 1, 80, 1),
(14, 174, 1, 0, 0, 3),
(15, 174, 1, 0, 0, 2),
(16, 173, 1, 2, 87, 1),
(17, 173, 1, 0, 0, 3),
(18, 173, 1, 0, 0, 2),
(19, 172, 1, 1, 93, 1),
(20, 172, 1, 0, 0, 3),
(21, 172, 1, 0, 0, 2),
(22, 171, 1, 1, 67, 1),
(23, 171, 1, 0, 0, 3),
(24, 171, 1, 0, 0, 2),
(25, 170, 1, 1, 73, 1),
(26, 170, 1, 0, 0, 3),
(27, 170, 1, 0, 0, 2),
(28, 181, 1, 1, 80, 1),
(29, 181, 1, 0, 0, 3),
(30, 181, 1, 0, 0, 2),
(31, 169, 1, 1, 93, 0),
(32, 179, 1, 1, 67, 0),
(33, 178, 1, 1, 80, 0),
(34, 176, 1, 1, 87, 0),
(35, 174, 1, 1, 80, 0),
(36, 173, 1, 2, 87, 0),
(37, 172, 1, 1, 93, 0),
(38, 171, 1, 1, 67, 0),
(39, 170, 1, 1, 73, 0),
(40, 181, 1, 1, 80, 0),
(41, 177, 1, 1, 93, 1),
(42, 177, 1, 0, 0, 3),
(43, 177, 1, 0, 0, 2),
(44, 180, 1, 1, 80, 1),
(45, 180, 1, 0, 0, 3),
(46, 180, 1, 0, 0, 2),
(47, 177, 1, 1, 93, 0),
(48, 180, 1, 1, 80, 0);

CREATE TABLE `#__review_status` (
  `status_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Status id',
  `status_code` varchar(32) NOT NULL COMMENT 'Status code',
  PRIMARY KEY (`status_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Review statuses';

INSERT INTO `#__review_status` (`status_id`, `status_code`) VALUES
(1, 'Approved'),
(2, 'Pending'),
(3, 'Not Approved');

CREATE TABLE `#__review_store` (
  `review_id` bigint(20) unsigned NOT NULL DEFAULT '0' COMMENT 'Review Id',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Id',
  PRIMARY KEY (`review_id`,`store_id`),
  KEY `IDX_REVIEW_STORE_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Review Store';

INSERT INTO `#__review_store` (`review_id`, `store_id`) VALUES
(1, 0),
(1, 1),
(2, 0),
(2, 1),
(3, 0),
(3, 1),
(4, 0),
(4, 1),
(5, 0),
(5, 1),
(6, 0),
(6, 1),
(7, 0),
(7, 1),
(8, 0),
(8, 1),
(9, 0),
(9, 1),
(10, 0),
(10, 1),
(11, 0),
(11, 1),
(12, 0),
(12, 1),
(13, 0),
(13, 1);

CREATE TABLE `#__sales_bestsellers_aggregated_daily` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `product_id` int(10) unsigned DEFAULT NULL COMMENT 'Product Id',
  `product_name` varchar(255) DEFAULT NULL COMMENT 'Product Name',
  `product_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Product Price',
  `qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Qty Ordered',
  `rating_pos` smallint(5) unsigned NOT NULL COMMENT 'Rating Pos',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_SALES_BESTSELLERS_AGGRED_DAILY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  KEY `IDX_SALES_BESTSELLERS_AGGREGATED_DAILY_STORE_ID` (`store_id`),
  KEY `IDX_SALES_BESTSELLERS_AGGREGATED_DAILY_PRODUCT_ID` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Bestsellers Aggregated Daily';


CREATE TABLE `#__sales_bestsellers_aggregated_monthly` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `product_id` int(10) unsigned DEFAULT NULL COMMENT 'Product Id',
  `product_name` varchar(255) DEFAULT NULL COMMENT 'Product Name',
  `product_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Product Price',
  `qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Qty Ordered',
  `rating_pos` smallint(5) unsigned NOT NULL COMMENT 'Rating Pos',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_SALES_BESTSELLERS_AGGRED_MONTHLY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  KEY `IDX_SALES_BESTSELLERS_AGGREGATED_MONTHLY_STORE_ID` (`store_id`),
  KEY `IDX_SALES_BESTSELLERS_AGGREGATED_MONTHLY_PRODUCT_ID` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Bestsellers Aggregated Monthly';


CREATE TABLE `#__sales_bestsellers_aggregated_yearly` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `product_id` int(10) unsigned DEFAULT NULL COMMENT 'Product Id',
  `product_name` varchar(255) DEFAULT NULL COMMENT 'Product Name',
  `product_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Product Price',
  `qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Qty Ordered',
  `rating_pos` smallint(5) unsigned NOT NULL COMMENT 'Rating Pos',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_SALES_BESTSELLERS_AGGRED_YEARLY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  KEY `IDX_SALES_BESTSELLERS_AGGREGATED_YEARLY_STORE_ID` (`store_id`),
  KEY `IDX_SALES_BESTSELLERS_AGGREGATED_YEARLY_PRODUCT_ID` (`product_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Bestsellers Aggregated Yearly';


CREATE TABLE `#__sales_billing_agreement` (
  `agreement_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Agreement Id',
  `customer_id` int(10) unsigned NOT NULL COMMENT 'Customer Id',
  `method_code` varchar(32) NOT NULL COMMENT 'Method Code',
  `reference_id` varchar(32) NOT NULL COMMENT 'Reference Id',
  `status` varchar(20) NOT NULL COMMENT 'Status',
  `created_at` timestamp NOT NULL COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `agreement_label` varchar(255) DEFAULT NULL COMMENT 'Agreement Label',
  PRIMARY KEY (`agreement_id`),
  KEY `FK_j502fa_FK_BILLING_AGREEMENT_STORE` (`store_id`),
  KEY `IDX_SALES_BILLING_AGREEMENT_CUSTOMER_ID` (`customer_id`),
  KEY `IDX_SALES_BILLING_AGREEMENT_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Sales Billing Agreement';

INSERT INTO `#__sales_billing_agreement` (`agreement_id`, `customer_id`, `method_code`, `reference_id`, `status`, `created_at`, `updated_at`, `store_id`, `agreement_label`) VALUES
(1, 2, 'paypal_billing_agreement', 'B-8B781553CD280015G', 'active', '2011-04-06 03:31:46', '2011-04-06 03:37:23', 1, 'PayPal Billing Agreement');

CREATE TABLE `#__sales_billing_agreement_order` (
  `agreement_id` int(10) unsigned NOT NULL COMMENT 'Agreement Id',
  `order_id` int(10) unsigned NOT NULL COMMENT 'Order Id',
  PRIMARY KEY (`agreement_id`,`order_id`),
  KEY `FK_j502fa_FK_BILLING_AGREEMENT_ORDER_ORDER` (`order_id`),
  KEY `IDX_SALES_BILLING_AGREEMENT_ORDER_ORDER_ID` (`order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Billing Agreement Order';

INSERT INTO `#__sales_billing_agreement_order` (`agreement_id`, `order_id`) VALUES
(1, 1);

CREATE TABLE `#__sales_flat_creditmemo` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `adjustment_positive` decimal(12,4) DEFAULT NULL COMMENT 'Adjustment Positive',
  `base_shipping_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Tax Amount',
  `store_to_order_rate` decimal(12,4) DEFAULT NULL COMMENT 'Store To Order Rate',
  `base_discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Discount Amount',
  `base_to_order_rate` decimal(12,4) DEFAULT NULL COMMENT 'Base To Order Rate',
  `grand_total` decimal(12,4) DEFAULT NULL COMMENT 'Grand Total',
  `base_adjustment_negative` decimal(12,4) DEFAULT NULL COMMENT 'Base Adjustment Negative',
  `base_subtotal_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Subtotal Incl Tax',
  `shipping_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Amount',
  `subtotal_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Subtotal Incl Tax',
  `adjustment_negative` decimal(12,4) DEFAULT NULL COMMENT 'Adjustment Negative',
  `base_shipping_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Amount',
  `store_to_base_rate` decimal(12,4) DEFAULT NULL COMMENT 'Store To Base Rate',
  `base_to_global_rate` decimal(12,4) DEFAULT NULL COMMENT 'Base To Global Rate',
  `base_adjustment` decimal(12,4) DEFAULT NULL COMMENT 'Base Adjustment',
  `base_subtotal` decimal(12,4) DEFAULT NULL COMMENT 'Base Subtotal',
  `discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Discount Amount',
  `subtotal` decimal(12,4) DEFAULT NULL COMMENT 'Subtotal',
  `adjustment` decimal(12,4) DEFAULT NULL COMMENT 'Adjustment',
  `base_grand_total` decimal(12,4) DEFAULT NULL COMMENT 'Base Grand Total',
  `base_adjustment_positive` decimal(12,4) DEFAULT NULL COMMENT 'Base Adjustment Positive',
  `base_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Tax Amount',
  `shipping_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Tax Amount',
  `tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Tax Amount',
  `order_id` int(10) unsigned NOT NULL COMMENT 'Order Id',
  `email_sent` smallint(5) unsigned DEFAULT NULL COMMENT 'Email Sent',
  `creditmemo_status` int(11) DEFAULT NULL COMMENT 'Creditmemo Status',
  `state` int(11) DEFAULT NULL COMMENT 'State',
  `shipping_address_id` int(11) DEFAULT NULL COMMENT 'Shipping Address Id',
  `billing_address_id` int(11) DEFAULT NULL COMMENT 'Billing Address Id',
  `invoice_id` int(11) DEFAULT NULL COMMENT 'Invoice Id',
  `cybersource_token` varchar(255) DEFAULT NULL,
  `store_currency_code` varchar(3) DEFAULT NULL COMMENT 'Store Currency Code',
  `order_currency_code` varchar(3) DEFAULT NULL COMMENT 'Order Currency Code',
  `base_currency_code` varchar(3) DEFAULT NULL COMMENT 'Base Currency Code',
  `global_currency_code` varchar(3) DEFAULT NULL COMMENT 'Global Currency Code',
  `transaction_id` varchar(255) DEFAULT NULL COMMENT 'Transaction Id',
  `increment_id` varchar(50) DEFAULT NULL COMMENT 'Increment Id',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  `hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Amount',
  `base_hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Hidden Tax Amount',
  `shipping_hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Hidden Tax Amount',
  `base_shipping_hidden_tax_amnt` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Hidden Tax Amount',
  `shipping_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Incl Tax',
  `base_shipping_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Incl Tax',
  `discount_description` varchar(255) DEFAULT NULL COMMENT 'Discount Description',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `UNQ_SALES_FLAT_CREDITMEMO_INCREMENT_ID` (`increment_id`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_STORE_ID` (`store_id`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_ORDER_ID` (`order_id`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_CREDITMEMO_STATUS` (`creditmemo_status`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_STATE` (`state`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_CREATED_AT` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Creditmemo';


CREATE TABLE `#__sales_flat_creditmemo_comment` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `parent_id` int(10) unsigned NOT NULL COMMENT 'Parent Id',
  `is_customer_notified` int(11) DEFAULT NULL COMMENT 'Is Customer Notified',
  `is_visible_on_front` smallint(5) unsigned NOT NULL COMMENT 'Is Visible On Front',
  `comment` text COMMENT 'Comment',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  PRIMARY KEY (`entity_id`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_COMMENT_CREATED_AT` (`created_at`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_COMMENT_PARENT_ID` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Creditmemo Comment';


CREATE TABLE `#__sales_flat_creditmemo_grid` (
  `entity_id` int(10) unsigned NOT NULL COMMENT 'Entity Id',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `store_to_order_rate` decimal(12,4) DEFAULT NULL COMMENT 'Store To Order Rate',
  `base_to_order_rate` decimal(12,4) DEFAULT NULL COMMENT 'Base To Order Rate',
  `grand_total` decimal(12,4) DEFAULT NULL COMMENT 'Grand Total',
  `store_to_base_rate` decimal(12,4) DEFAULT NULL COMMENT 'Store To Base Rate',
  `base_to_global_rate` decimal(12,4) DEFAULT NULL COMMENT 'Base To Global Rate',
  `base_grand_total` decimal(12,4) DEFAULT NULL COMMENT 'Base Grand Total',
  `order_id` int(10) unsigned NOT NULL COMMENT 'Order Id',
  `creditmemo_status` int(11) DEFAULT NULL COMMENT 'Creditmemo Status',
  `state` int(11) DEFAULT NULL COMMENT 'State',
  `invoice_id` int(11) DEFAULT NULL COMMENT 'Invoice Id',
  `store_currency_code` varchar(3) DEFAULT NULL COMMENT 'Store Currency Code',
  `order_currency_code` varchar(3) DEFAULT NULL COMMENT 'Order Currency Code',
  `base_currency_code` varchar(3) DEFAULT NULL COMMENT 'Base Currency Code',
  `global_currency_code` varchar(3) DEFAULT NULL COMMENT 'Global Currency Code',
  `increment_id` varchar(50) DEFAULT NULL COMMENT 'Increment Id',
  `order_increment_id` varchar(50) DEFAULT NULL COMMENT 'Order Increment Id',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `order_created_at` timestamp NULL DEFAULT NULL COMMENT 'Order Created At',
  `billing_name` varchar(255) DEFAULT NULL COMMENT 'Billing Name',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `UNQ_SALES_FLAT_CREDITMEMO_GRID_INCREMENT_ID` (`increment_id`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_GRID_STORE_ID` (`store_id`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_GRID_GRAND_TOTAL` (`grand_total`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_GRID_BASE_GRAND_TOTAL` (`base_grand_total`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_GRID_ORDER_ID` (`order_id`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_GRID_CREDITMEMO_STATUS` (`creditmemo_status`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_GRID_STATE` (`state`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_GRID_ORDER_INCREMENT_ID` (`order_increment_id`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_GRID_CREATED_AT` (`created_at`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_GRID_ORDER_CREATED_AT` (`order_created_at`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_GRID_BILLING_NAME` (`billing_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Creditmemo Grid';


CREATE TABLE `#__sales_flat_creditmemo_item` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `parent_id` int(10) unsigned NOT NULL COMMENT 'Parent Id',
  `weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Row Amount',
  `base_price` decimal(12,4) DEFAULT NULL COMMENT 'Base Price',
  `base_weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Row Disposition',
  `tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Tax Amount',
  `base_weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Amount',
  `weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Row Disposition',
  `base_row_total` decimal(12,4) DEFAULT NULL COMMENT 'Base Row Total',
  `discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Discount Amount',
  `row_total` decimal(12,4) DEFAULT NULL COMMENT 'Row Total',
  `weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Amount',
  `base_discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Discount Amount',
  `base_weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Disposition',
  `price_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Price Incl Tax',
  `base_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Tax Amount',
  `weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Disposition',
  `base_price_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Price Incl Tax',
  `qty` decimal(12,4) DEFAULT NULL COMMENT 'Qty',
  `base_cost` decimal(12,4) DEFAULT NULL COMMENT 'Base Cost',
  `base_weee_tax_applied_row_amnt` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Row Amnt',
  `price` decimal(12,4) DEFAULT NULL COMMENT 'Price',
  `base_row_total_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Row Total Incl Tax',
  `row_total_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Row Total Incl Tax',
  `product_id` int(11) DEFAULT NULL COMMENT 'Product Id',
  `order_item_id` int(11) DEFAULT NULL COMMENT 'Order Item Id',
  `additional_data` text COMMENT 'Additional Data',
  `description` text COMMENT 'Description',
  `weee_tax_applied` text COMMENT 'Weee Tax Applied',
  `sku` varchar(255) DEFAULT NULL COMMENT 'Sku',
  `name` varchar(255) DEFAULT NULL COMMENT 'Name',
  `hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Amount',
  `base_hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Hidden Tax Amount',
  PRIMARY KEY (`entity_id`),
  KEY `IDX_SALES_FLAT_CREDITMEMO_ITEM_PARENT_ID` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Creditmemo Item';


CREATE TABLE `#__sales_flat_invoice` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `base_grand_total` decimal(12,4) DEFAULT NULL COMMENT 'Base Grand Total',
  `shipping_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Tax Amount',
  `tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Tax Amount',
  `base_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Tax Amount',
  `store_to_order_rate` decimal(12,4) DEFAULT NULL COMMENT 'Store To Order Rate',
  `base_shipping_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Tax Amount',
  `base_discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Discount Amount',
  `base_to_order_rate` decimal(12,4) DEFAULT NULL COMMENT 'Base To Order Rate',
  `grand_total` decimal(12,4) DEFAULT NULL COMMENT 'Grand Total',
  `shipping_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Amount',
  `subtotal_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Subtotal Incl Tax',
  `base_subtotal_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Subtotal Incl Tax',
  `store_to_base_rate` decimal(12,4) DEFAULT NULL COMMENT 'Store To Base Rate',
  `base_shipping_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Amount',
  `total_qty` decimal(12,4) DEFAULT NULL COMMENT 'Total Qty',
  `base_to_global_rate` decimal(12,4) DEFAULT NULL COMMENT 'Base To Global Rate',
  `subtotal` decimal(12,4) DEFAULT NULL COMMENT 'Subtotal',
  `base_subtotal` decimal(12,4) DEFAULT NULL COMMENT 'Base Subtotal',
  `discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Discount Amount',
  `billing_address_id` int(11) DEFAULT NULL COMMENT 'Billing Address Id',
  `is_used_for_refund` smallint(5) unsigned DEFAULT NULL COMMENT 'Is Used For Refund',
  `order_id` int(10) unsigned NOT NULL COMMENT 'Order Id',
  `email_sent` smallint(5) unsigned DEFAULT NULL COMMENT 'Email Sent',
  `can_void_flag` smallint(5) unsigned DEFAULT NULL COMMENT 'Can Void Flag',
  `state` int(11) DEFAULT NULL COMMENT 'State',
  `shipping_address_id` int(11) DEFAULT NULL COMMENT 'Shipping Address Id',
  `cybersource_token` varchar(255) DEFAULT NULL,
  `store_currency_code` varchar(3) DEFAULT NULL COMMENT 'Store Currency Code',
  `transaction_id` varchar(255) DEFAULT NULL COMMENT 'Transaction Id',
  `order_currency_code` varchar(3) DEFAULT NULL COMMENT 'Order Currency Code',
  `base_currency_code` varchar(3) DEFAULT NULL COMMENT 'Base Currency Code',
  `global_currency_code` varchar(3) DEFAULT NULL COMMENT 'Global Currency Code',
  `increment_id` varchar(50) DEFAULT NULL COMMENT 'Increment Id',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  `customer_id` int(11) DEFAULT NULL,
  `invoice_status_id` int(11) DEFAULT NULL,
  `invoice_type` int(11) DEFAULT NULL,
  `is_virtual` int(11) DEFAULT NULL,
  `real_order_id` varchar(255) DEFAULT NULL,
  `total_due` decimal(12,4) DEFAULT NULL,
  `total_paid` decimal(12,4) DEFAULT NULL,
  `hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Amount',
  `base_hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Hidden Tax Amount',
  `shipping_hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Hidden Tax Amount',
  `base_shipping_hidden_tax_amnt` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Hidden Tax Amount',
  `shipping_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Incl Tax',
  `base_shipping_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Incl Tax',
  `base_total_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Base Total Refunded',
  `discount_description` varchar(255) DEFAULT NULL COMMENT 'Discount Description',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `UNQ_SALES_FLAT_INVOICE_INCREMENT_ID` (`increment_id`),
  KEY `IDX_SALES_FLAT_INVOICE_STORE_ID` (`store_id`),
  KEY `IDX_SALES_FLAT_INVOICE_GRAND_TOTAL` (`grand_total`),
  KEY `IDX_SALES_FLAT_INVOICE_ORDER_ID` (`order_id`),
  KEY `IDX_SALES_FLAT_INVOICE_STATE` (`state`),
  KEY `IDX_SALES_FLAT_INVOICE_CREATED_AT` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Invoice';


CREATE TABLE `#__sales_flat_invoice_comment` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `parent_id` int(10) unsigned NOT NULL COMMENT 'Parent Id',
  `is_customer_notified` smallint(5) unsigned DEFAULT NULL COMMENT 'Is Customer Notified',
  `is_visible_on_front` smallint(5) unsigned NOT NULL COMMENT 'Is Visible On Front',
  `comment` text COMMENT 'Comment',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  PRIMARY KEY (`entity_id`),
  KEY `IDX_SALES_FLAT_INVOICE_COMMENT_CREATED_AT` (`created_at`),
  KEY `IDX_SALES_FLAT_INVOICE_COMMENT_PARENT_ID` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Invoice Comment';


CREATE TABLE `#__sales_flat_invoice_grid` (
  `entity_id` int(10) unsigned NOT NULL COMMENT 'Entity Id',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `base_grand_total` decimal(12,4) DEFAULT NULL COMMENT 'Base Grand Total',
  `grand_total` decimal(12,4) DEFAULT NULL COMMENT 'Grand Total',
  `order_id` int(10) unsigned NOT NULL COMMENT 'Order Id',
  `state` int(11) DEFAULT NULL COMMENT 'State',
  `store_currency_code` varchar(3) DEFAULT NULL COMMENT 'Store Currency Code',
  `order_currency_code` varchar(3) DEFAULT NULL COMMENT 'Order Currency Code',
  `base_currency_code` varchar(3) DEFAULT NULL COMMENT 'Base Currency Code',
  `global_currency_code` varchar(3) DEFAULT NULL COMMENT 'Global Currency Code',
  `increment_id` varchar(50) DEFAULT NULL COMMENT 'Increment Id',
  `order_increment_id` varchar(50) DEFAULT NULL COMMENT 'Order Increment Id',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `order_created_at` timestamp NULL DEFAULT NULL COMMENT 'Order Created At',
  `billing_name` varchar(255) DEFAULT NULL COMMENT 'Billing Name',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `UNQ_SALES_FLAT_INVOICE_GRID_INCREMENT_ID` (`increment_id`),
  KEY `IDX_SALES_FLAT_INVOICE_GRID_STORE_ID` (`store_id`),
  KEY `IDX_SALES_FLAT_INVOICE_GRID_GRAND_TOTAL` (`grand_total`),
  KEY `IDX_SALES_FLAT_INVOICE_GRID_ORDER_ID` (`order_id`),
  KEY `IDX_SALES_FLAT_INVOICE_GRID_STATE` (`state`),
  KEY `IDX_SALES_FLAT_INVOICE_GRID_ORDER_INCREMENT_ID` (`order_increment_id`),
  KEY `IDX_SALES_FLAT_INVOICE_GRID_CREATED_AT` (`created_at`),
  KEY `IDX_SALES_FLAT_INVOICE_GRID_ORDER_CREATED_AT` (`order_created_at`),
  KEY `IDX_SALES_FLAT_INVOICE_GRID_BILLING_NAME` (`billing_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Invoice Grid';


CREATE TABLE `#__sales_flat_invoice_item` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `parent_id` int(10) unsigned NOT NULL COMMENT 'Parent Id',
  `base_price` decimal(12,4) DEFAULT NULL COMMENT 'Base Price',
  `base_weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Row Disposition',
  `weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Row Amount',
  `base_weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Amount',
  `tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Tax Amount',
  `base_row_total` decimal(12,4) DEFAULT NULL COMMENT 'Base Row Total',
  `discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Discount Amount',
  `row_total` decimal(12,4) DEFAULT NULL COMMENT 'Row Total',
  `weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Row Disposition',
  `base_discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Discount Amount',
  `base_weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Disposition',
  `price_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Price Incl Tax',
  `weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Amount',
  `base_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Tax Amount',
  `base_price_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Price Incl Tax',
  `qty` decimal(12,4) DEFAULT NULL COMMENT 'Qty',
  `weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Disposition',
  `base_cost` decimal(12,4) DEFAULT NULL COMMENT 'Base Cost',
  `base_weee_tax_applied_row_amnt` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Row Amnt',
  `price` decimal(12,4) DEFAULT NULL COMMENT 'Price',
  `base_row_total_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Row Total Incl Tax',
  `row_total_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Row Total Incl Tax',
  `product_id` int(11) DEFAULT NULL COMMENT 'Product Id',
  `order_item_id` int(11) DEFAULT NULL COMMENT 'Order Item Id',
  `additional_data` text COMMENT 'Additional Data',
  `description` text COMMENT 'Description',
  `weee_tax_applied` text COMMENT 'Weee Tax Applied',
  `sku` varchar(255) DEFAULT NULL COMMENT 'Sku',
  `name` varchar(255) DEFAULT NULL COMMENT 'Name',
  `shipment_id` int(11) DEFAULT NULL,
  `hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Amount',
  `base_hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Hidden Tax Amount',
  PRIMARY KEY (`entity_id`),
  KEY `IDX_SALES_FLAT_INVOICE_ITEM_PARENT_ID` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Invoice Item';

CREATE TABLE `#__sales_flat_order_address` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `parent_id` int(10) unsigned DEFAULT NULL COMMENT 'Parent Id',
  `customer_address_id` int(11) DEFAULT NULL COMMENT 'Customer Address Id',
  `quote_address_id` int(11) DEFAULT NULL COMMENT 'Quote Address Id',
  `region_id` int(11) DEFAULT NULL COMMENT 'Region Id',
  `customer_id` int(11) DEFAULT NULL COMMENT 'Customer Id',
  `fax` varchar(255) DEFAULT NULL COMMENT 'Fax',
  `region` varchar(255) DEFAULT NULL COMMENT 'Region',
  `postcode` varchar(255) DEFAULT NULL COMMENT 'Postcode',
  `lastname` varchar(255) DEFAULT NULL COMMENT 'Lastname',
  `street` varchar(255) DEFAULT NULL COMMENT 'Street',
  `city` varchar(255) DEFAULT NULL COMMENT 'City',
  `email` varchar(255) DEFAULT NULL COMMENT 'Email',
  `telephone` varchar(255) DEFAULT NULL COMMENT 'Telephone',
  `country_id` varchar(2) DEFAULT NULL COMMENT 'Country Id',
  `firstname` varchar(255) DEFAULT NULL COMMENT 'Firstname',
  `address_type` varchar(255) DEFAULT NULL COMMENT 'Address Type',
  `prefix` varchar(255) DEFAULT NULL COMMENT 'Prefix',
  `middlename` varchar(255) DEFAULT NULL COMMENT 'Middlename',
  `suffix` varchar(255) DEFAULT NULL COMMENT 'Suffix',
  `company` varchar(255) DEFAULT NULL COMMENT 'Company',
  `address_id` int(11) DEFAULT NULL,
  `gift_message_id` int(11) DEFAULT NULL,
  `tax_id` varchar(255) DEFAULT NULL,
  `vat_id` text COMMENT 'Vat Id',
  `vat_is_valid` smallint(6) DEFAULT NULL COMMENT 'Vat Is Valid',
  `vat_request_id` text COMMENT 'Vat Request Id',
  `vat_request_date` text COMMENT 'Vat Request Date',
  `vat_request_success` smallint(6) DEFAULT NULL COMMENT 'Vat Request Success',
  PRIMARY KEY (`entity_id`),
  KEY `IDX_SALES_FLAT_ORDER_ADDRESS_PARENT_ID` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Sales Flat Order Address';

INSERT INTO `#__sales_flat_order_address` (`entity_id`, `parent_id`, `customer_address_id`, `quote_address_id`, `region_id`, `customer_id`, `fax`, `region`, `postcode`, `lastname`, `street`, `city`, `email`, `telephone`, `country_id`, `firstname`, `address_type`, `prefix`, `middlename`, `suffix`, `company`, `address_id`, `gift_message_id`, `tax_id`, `vat_id`, `vat_is_valid`, `vat_request_id`, `vat_request_date`, `vat_request_success`) VALUES
(1, 1, NULL, NULL, NULL, 2, '', '', '084', 'Hien Duc', 'Dan Phuong', 'Ha Noi', NULL, '0912939475', 'VN', 'Huynh', 'billing', NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(2, 1, NULL, NULL, NULL, 2, '', '', '084', 'Hien Duc', 'Dan Phuong', 'Ha Noi', NULL, '0912939475', 'VN', 'Huynh', 'shipping', NULL, NULL, NULL, '', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(3, 2, 2, NULL, NULL, 3, NULL, NULL, '084', 'JoomSolutlions', 'Thanh Xuan', 'Ha Noi', NULL, '0912939475', 'VN', 'Joom', 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(4, 2, NULL, NULL, NULL, 3, NULL, NULL, '084', 'JoomSolutlions', 'Thanh Xuan', 'Ha Noi', NULL, '0912939475', 'VN', 'Joom', 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(5, 3, 2, NULL, NULL, 3, NULL, NULL, '084', 'JoomSolutlions', 'Thanh Xuan', 'Ha Noi', 'joom@joom.vn', '0912939475', 'VN', 'Joom', 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(6, 3, 2, NULL, NULL, 3, NULL, NULL, '084', 'JoomSolutlions', 'Thanh Xuan', 'Ha Noi', 'joom@joom.vn', '0912939475', 'VN', 'Joom', 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(7, 4, 2, NULL, NULL, 3, NULL, NULL, '084', 'JoomSolutlions', 'Thanh Xuan', 'Ha Noi', 'joom@joom.vn', '0912939475', 'VN', 'Joom', 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(8, 4, 2, NULL, NULL, 3, NULL, NULL, '084', 'JoomSolutlions', 'Thanh Xuan', 'Ha Noi', 'joom@joom.vn', '0912939475', 'VN', 'Joom', 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(9, 5, 2, NULL, NULL, 3, NULL, NULL, '084', 'JoomSolutlions', 'Thanh Xuan', 'Ha Noi', 'joom@joom.vn', '0912939475', 'VN', 'Joom', 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(10, 5, 2, NULL, NULL, 3, NULL, NULL, '084', 'JoomSolutlions', 'Thanh Xuan', 'Ha Noi', 'joom@joom.vn', '0912939475', 'VN', 'Joom', 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(11, 6, 2, NULL, NULL, 3, NULL, NULL, '084', 'JoomSolutlions', 'Thanh Xuan', 'Ha Noi', 'joom@joom.vn', '0912939475', 'VN', 'Joom', 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL),
(12, 6, 2, NULL, NULL, 3, NULL, NULL, '084', 'JoomSolutlions', 'Thanh Xuan', 'Ha Noi', 'joom@joom.vn', '0912939475', 'VN', 'Joom', 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);

CREATE TABLE `#__sales_flat_order_grid` (
  `entity_id` int(10) unsigned NOT NULL COMMENT 'Entity Id',
  `status` varchar(32) DEFAULT NULL COMMENT 'Status',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `store_name` varchar(255) DEFAULT NULL COMMENT 'Store Name',
  `customer_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer Id',
  `base_grand_total` decimal(12,4) DEFAULT NULL COMMENT 'Base Grand Total',
  `base_total_paid` decimal(12,4) DEFAULT NULL COMMENT 'Base Total Paid',
  `grand_total` decimal(12,4) DEFAULT NULL COMMENT 'Grand Total',
  `total_paid` decimal(12,4) DEFAULT NULL COMMENT 'Total Paid',
  `increment_id` varchar(50) DEFAULT NULL COMMENT 'Increment Id',
  `base_currency_code` varchar(3) DEFAULT NULL COMMENT 'Base Currency Code',
  `order_currency_code` varchar(255) DEFAULT NULL COMMENT 'Order Currency Code',
  `shipping_name` varchar(255) DEFAULT NULL COMMENT 'Shipping Name',
  `billing_name` varchar(255) DEFAULT NULL COMMENT 'Billing Name',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `UNQ_SALES_FLAT_ORDER_GRID_INCREMENT_ID` (`increment_id`),
  KEY `IDX_SALES_FLAT_ORDER_GRID_STATUS` (`status`),
  KEY `IDX_SALES_FLAT_ORDER_GRID_STORE_ID` (`store_id`),
  KEY `IDX_SALES_FLAT_ORDER_GRID_BASE_GRAND_TOTAL` (`base_grand_total`),
  KEY `IDX_SALES_FLAT_ORDER_GRID_BASE_TOTAL_PAID` (`base_total_paid`),
  KEY `IDX_SALES_FLAT_ORDER_GRID_GRAND_TOTAL` (`grand_total`),
  KEY `IDX_SALES_FLAT_ORDER_GRID_TOTAL_PAID` (`total_paid`),
  KEY `IDX_SALES_FLAT_ORDER_GRID_SHIPPING_NAME` (`shipping_name`),
  KEY `IDX_SALES_FLAT_ORDER_GRID_BILLING_NAME` (`billing_name`),
  KEY `IDX_SALES_FLAT_ORDER_GRID_CREATED_AT` (`created_at`),
  KEY `IDX_SALES_FLAT_ORDER_GRID_CUSTOMER_ID` (`customer_id`),
  KEY `IDX_SALES_FLAT_ORDER_GRID_UPDATED_AT` (`updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Order Grid';

INSERT INTO `#__sales_flat_order_grid` (`entity_id`, `status`, `store_id`, `store_name`, `customer_id`, `base_grand_total`, `base_total_paid`, `grand_total`, `total_paid`, `increment_id`, `base_currency_code`, `order_currency_code`, `shipping_name`, `billing_name`, `created_at`, `updated_at`) VALUES
(1, 'payment_review', 1, 'Main Website\nMain Store\nEnglish', 2, '404.9900', NULL, '404.9900', NULL, '100000001', 'USD', 'USD', 'Huynh Hien Duc', 'Huynh Hien Duc', '2011-04-06 03:37:14', '2011-04-06 03:37:23'),
(2, 'pending', 1, 'Main Website\nMain Store\nEnglish', 3, '39.0000', NULL, '39.0000', NULL, '100000003', 'USD', 'USD', 'Joom JoomSolutlions', 'Joom JoomSolutlions', '2011-11-09 07:36:17', '2011-11-09 07:36:21'),
(3, 'pending', 1, 'Main Website\nMain Store\nEnglish', 3, '304.9900', NULL, '304.9900', NULL, '100000004', 'USD', 'USD', 'Joom JoomSolutlions', 'Joom JoomSolutlions', '2011-11-09 09:11:25', '2011-11-09 09:11:25'),
(4, 'pending', 1, 'Main Website\nMain Store\nEnglish', 3, '2928.9900', NULL, '2928.9900', NULL, '100000005', 'USD', 'USD', 'Joom JoomSolutlions', 'Joom JoomSolutlions', '2011-11-23 04:28:24', '2011-11-23 04:28:32'),
(5, 'pending', 1, 'Main Website\nMain Store\nEnglish', 3, '719.9900', NULL, '719.9900', NULL, '100000006', 'USD', 'USD', 'Joom JoomSolutlions', 'Joom JoomSolutlions', '2011-11-24 03:18:39', '2011-11-24 03:18:39'),
(6, 'pending', 1, 'Main Website\nMain Store\nEnglish', 3, '282.0000', NULL, '282.0000', NULL, '100000007', 'USD', 'USD', 'Joom JoomSolutlions', 'Joom JoomSolutlions', '2012-08-22 02:10:41', '2012-08-22 02:10:45');

CREATE TABLE `#__sales_flat_order_item` (
  `item_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Item Id',
  `order_id` int(10) unsigned NOT NULL COMMENT 'Order Id',
  `parent_item_id` int(10) unsigned DEFAULT NULL COMMENT 'Parent Item Id',
  `quote_item_id` int(10) unsigned DEFAULT NULL COMMENT 'Quote Item Id',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `created_at` timestamp NOT NULL COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Updated At',
  `product_id` int(10) unsigned DEFAULT NULL COMMENT 'Product Id',
  `product_type` varchar(255) DEFAULT NULL COMMENT 'Product Type',
  `product_options` text COMMENT 'Product Options',
  `weight` decimal(12,4) DEFAULT '0.0000' COMMENT 'Weight',
  `is_virtual` smallint(5) unsigned DEFAULT NULL COMMENT 'Is Virtual',
  `sku` varchar(255) DEFAULT NULL COMMENT 'Sku',
  `name` varchar(255) DEFAULT NULL COMMENT 'Name',
  `description` text COMMENT 'Description',
  `applied_rule_ids` text COMMENT 'Applied Rule Ids',
  `additional_data` text COMMENT 'Additional Data',
  `free_shipping` smallint(5) unsigned NOT NULL COMMENT 'Free Shipping',
  `is_qty_decimal` smallint(5) unsigned DEFAULT NULL COMMENT 'Is Qty Decimal',
  `no_discount` smallint(5) unsigned NOT NULL COMMENT 'No Discount',
  `qty_backordered` decimal(12,4) DEFAULT '0.0000' COMMENT 'Qty Backordered',
  `qty_canceled` decimal(12,4) DEFAULT '0.0000' COMMENT 'Qty Canceled',
  `qty_invoiced` decimal(12,4) DEFAULT '0.0000' COMMENT 'Qty Invoiced',
  `qty_ordered` decimal(12,4) DEFAULT '0.0000' COMMENT 'Qty Ordered',
  `qty_refunded` decimal(12,4) DEFAULT '0.0000' COMMENT 'Qty Refunded',
  `qty_shipped` decimal(12,4) DEFAULT '0.0000' COMMENT 'Qty Shipped',
  `base_cost` decimal(12,4) DEFAULT '0.0000' COMMENT 'Base Cost',
  `price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Price',
  `base_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Price',
  `original_price` decimal(12,4) DEFAULT NULL COMMENT 'Original Price',
  `base_original_price` decimal(12,4) DEFAULT NULL COMMENT 'Base Original Price',
  `tax_percent` decimal(12,4) DEFAULT '0.0000' COMMENT 'Tax Percent',
  `tax_amount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Tax Amount',
  `base_tax_amount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Base Tax Amount',
  `tax_invoiced` decimal(12,4) DEFAULT '0.0000' COMMENT 'Tax Invoiced',
  `base_tax_invoiced` decimal(12,4) DEFAULT '0.0000' COMMENT 'Base Tax Invoiced',
  `discount_percent` decimal(12,4) DEFAULT '0.0000' COMMENT 'Discount Percent',
  `discount_amount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Discount Amount',
  `base_discount_amount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Base Discount Amount',
  `discount_invoiced` decimal(12,4) DEFAULT '0.0000' COMMENT 'Discount Invoiced',
  `base_discount_invoiced` decimal(12,4) DEFAULT '0.0000' COMMENT 'Base Discount Invoiced',
  `amount_refunded` decimal(12,4) DEFAULT '0.0000' COMMENT 'Amount Refunded',
  `base_amount_refunded` decimal(12,4) DEFAULT '0.0000' COMMENT 'Base Amount Refunded',
  `row_total` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Row Total',
  `base_row_total` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Row Total',
  `row_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Row Invoiced',
  `base_row_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Row Invoiced',
  `row_weight` decimal(12,4) DEFAULT '0.0000' COMMENT 'Row Weight',
  `gift_message_id` int(11) DEFAULT NULL COMMENT 'Gift Message Id',
  `gift_message_available` int(11) DEFAULT NULL COMMENT 'Gift Message Available',
  `base_tax_before_discount` decimal(12,4) DEFAULT NULL COMMENT 'Base Tax Before Discount',
  `tax_before_discount` decimal(12,4) DEFAULT NULL COMMENT 'Tax Before Discount',
  `weee_tax_applied` text COMMENT 'Weee Tax Applied',
  `weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Amount',
  `weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Row Amount',
  `base_weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Amount',
  `base_weee_tax_applied_row_amnt` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Row Amnt',
  `weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Disposition',
  `weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Row Disposition',
  `base_weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Disposition',
  `base_weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Row Disposition',
  `ext_order_item_id` varchar(255) DEFAULT NULL COMMENT 'Ext Order Item Id',
  `locked_do_invoice` smallint(5) unsigned DEFAULT NULL COMMENT 'Locked Do Invoice',
  `locked_do_ship` smallint(5) unsigned DEFAULT NULL COMMENT 'Locked Do Ship',
  `price_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Price Incl Tax',
  `base_price_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Price Incl Tax',
  `row_total_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Row Total Incl Tax',
  `base_row_total_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Row Total Incl Tax',
  `hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Amount',
  `base_hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Hidden Tax Amount',
  `hidden_tax_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Invoiced',
  `base_hidden_tax_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Base Hidden Tax Invoiced',
  `hidden_tax_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Refunded',
  `base_hidden_tax_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Base Hidden Tax Refunded',
  `is_nominal` int(11) NOT NULL COMMENT 'Is Nominal',
  `tax_canceled` decimal(12,4) DEFAULT NULL COMMENT 'Tax Canceled',
  `hidden_tax_canceled` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Canceled',
  `tax_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Tax Refunded',
  `base_tax_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Base Tax Refunded',
  `discount_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Discount Refunded',
  `base_discount_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Base Discount Refunded',
  PRIMARY KEY (`item_id`),
  KEY `j502fa_FK_FK_SALES_ORDER_ITEM_STORE` (`store_id`),
  KEY `IDX_SALES_FLAT_ORDER_ITEM_ORDER_ID` (`order_id`),
  KEY `IDX_SALES_FLAT_ORDER_ITEM_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Sales Flat Order Item';

INSERT INTO `#__sales_flat_order_item` (`item_id`, `order_id`, `parent_item_id`, `quote_item_id`, `store_id`, `created_at`, `updated_at`, `product_id`, `product_type`, `product_options`, `weight`, `is_virtual`, `sku`, `name`, `description`, `applied_rule_ids`, `additional_data`, `free_shipping`, `is_qty_decimal`, `no_discount`, `qty_backordered`, `qty_canceled`, `qty_invoiced`, `qty_ordered`, `qty_refunded`, `qty_shipped`, `base_cost`, `price`, `base_price`, `original_price`, `base_original_price`, `tax_percent`, `tax_amount`, `base_tax_amount`, `tax_invoiced`, `base_tax_invoiced`, `discount_percent`, `discount_amount`, `base_discount_amount`, `discount_invoiced`, `base_discount_invoiced`, `amount_refunded`, `base_amount_refunded`, `row_total`, `base_row_total`, `row_invoiced`, `base_row_invoiced`, `row_weight`, `gift_message_id`, `gift_message_available`, `base_tax_before_discount`, `tax_before_discount`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `ext_order_item_id`, `locked_do_invoice`, `locked_do_ship`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `hidden_tax_amount`, `base_hidden_tax_amount`, `hidden_tax_invoiced`, `base_hidden_tax_invoiced`, `hidden_tax_refunded`, `base_hidden_tax_refunded`, `is_nominal`, `tax_canceled`, `hidden_tax_canceled`, `tax_refunded`, `base_tax_refunded`, `discount_refunded`, `base_discount_refunded`) VALUES
(1, 1, NULL, 1, 1, '2011-04-06 03:37:14', '2011-04-06 03:37:14', 18, 'simple', 'a:1:{s:15:"info_buyRequest";a:3:{s:4:"uenc";s:148:"aHR0cDovL2Rldi5qb29tbGFydC5jb20vamFkZXYyX2RhdGEvc2l0ZXMvYXV0by9xcy5qbXRjcHVyaXR5LjEzMDIwNTM4NTcvaW5kZXgucGhwL2VsZWN0cm9uaWNzL2NlbGwtcGhvbmVzLmh0bWw,";s:7:"product";s:2:"18";s:3:"qty";i:1;}}', '13.6000', 0, 'sw810i', 'Sony Ericsson W810i', NULL, '', NULL, 0, 0, 0, NULL, '0.0000', '0.0000', '1.0000', '0.0000', '0.0000', '29.9900', '399.9900', '399.9900', '399.9900', '399.9900', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '399.9900', '399.9900', '0.0000', '0.0000', '13.6000', NULL, 0, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, NULL, '399.9900', '399.9900', '399.9900', '399.9900', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(2, 2, NULL, 5, 1, '2011-11-09 07:36:18', '2011-11-09 07:36:18', 133, 'simple', 'a:1:{s:15:"info_buyRequest";a:5:{s:4:"uenc";s:148:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fYmxhbmtfMTYxMC9pbmRleC5waHAvZWxlY3Ryb25pY3MvY2FtZXJhcy9hY2Nlc3Nvcmllcy91bml2ZXJzYWwtY2FtZXJhLWNhc2UuaHRtbA,,";s:7:"product";s:3:"133";s:15:"related_product";s:0:"";s:3:"qty";s:1:"1";s:10:"return_url";s:0:"";}}', NULL, 0, 'ac9003', 'Universal Camera Case', NULL, '1', NULL, 0, 0, 0, NULL, '0.0000', '0.0000', '1.0000', '0.0000', '0.0000', NULL, '34.0000', '34.0000', '34.0000', '34.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '34.0000', '34.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, NULL, '34.0000', '34.0000', '34.0000', '34.0000', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(3, 3, NULL, 8, NULL, '2011-11-09 09:11:25', '2011-11-09 09:11:25', 51, 'simple', 'a:1:{s:15:"info_buyRequest";a:5:{s:4:"uenc";s:84:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fYmxhbmtfMTYxMC9pbmRleC5waHAvb3R0b21hbi5odG1s";s:7:"product";s:2:"51";s:15:"related_product";s:0:"";s:3:"qty";s:1:"1";s:10:"return_url";s:0:"";}}', '20.0000', NULL, '1111', 'Ottoman', NULL, NULL, NULL, 0, NULL, 0, NULL, '0.0000', '0.0000', '1.0000', '0.0000', '0.0000', NULL, '299.9900', '299.9900', '299.9900', '299.9900', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '299.9900', '299.9900', '0.0000', '0.0000', '20.0000', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, NULL, '299.9900', '299.9900', '299.9900', '299.9900', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(4, 4, NULL, 7, 1, '2011-11-23 04:28:24', '2011-11-23 04:28:24', 119, 'configurable', 'a:6:{s:15:"info_buyRequest";a:6:{s:4:"uenc";s:152:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fYmxhbmtfMTYxMC9pbmRleC5waHAvYXBwYXJlbC9zaGlydHMvY29hbGVzY2UtZnVuY3Rpb25pbmctb24taW1wYXRpZW5jZS10LXNoaXJ0Lmh0bWw,";s:7:"product";s:3:"119";s:15:"related_product";s:0:"";s:15:"super_attribute";a:1:{i:525;s:3:"100";}s:3:"qty";s:1:"1";s:10:"return_url";s:0:"";}s:15:"attributes_info";a:1:{i:0;a:2:{s:5:"label";s:4:"Size";s:5:"value";s:5:"Small";}}s:11:"simple_name";s:43:"Coalesce: Functioning On Impatience T-Shirt";s:10:"simple_sku";s:7:"coal_sm";s:20:"product_calculations";i:1;s:13:"shipment_type";i:0;}', '0.5000', 0, 'coal_sm', 'Coalesce: Functioning On Impatience T-Shirt', NULL, NULL, NULL, 0, 0, 0, NULL, '0.0000', '0.0000', '1.0000', '0.0000', '0.0000', '2.0000', '15.0000', '15.0000', '15.0000', '15.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '15.0000', '15.0000', '0.0000', '0.0000', '0.5000', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, NULL, '15.0000', '15.0000', '15.0000', '15.0000', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(5, 4, 4, 8, 1, '2011-11-23 04:28:27', '2011-11-23 04:28:27', 35, 'simple', 'a:1:{s:15:"info_buyRequest";a:6:{s:4:"uenc";s:152:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fYmxhbmtfMTYxMC9pbmRleC5waHAvYXBwYXJlbC9zaGlydHMvY29hbGVzY2UtZnVuY3Rpb25pbmctb24taW1wYXRpZW5jZS10LXNoaXJ0Lmh0bWw,";s:7:"product";s:3:"119";s:15:"related_product";s:0:"";s:15:"super_attribute";a:1:{i:525;s:3:"100";}s:3:"qty";s:1:"1";s:10:"return_url";s:0:"";}}', '0.5000', 0, 'coal_sm', 'Coalesce: Functioning On Impatience T-Shirt', NULL, NULL, NULL, 0, 0, 0, NULL, '0.0000', '0.0000', '1.0000', '0.0000', '0.0000', '2.0000', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(6, 4, NULL, 10, 1, '2011-11-23 04:28:29', '2011-11-23 04:28:29', 53, 'simple', 'a:1:{s:15:"info_buyRequest";a:3:{s:4:"uenc";s:88:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fYmxhbmtfMTYxMC9pbmRleC5waHAvZnVybml0dXJlLmh0bWw,";s:7:"product";s:2:"53";s:3:"qty";i:1;}}', '200.0000', 0, '1113', 'Couch', NULL, NULL, NULL, 0, 0, 0, NULL, '0.0000', '0.0000', '1.0000', '0.0000', '0.0000', '200.0000', '599.9900', '599.9900', '599.9900', '599.9900', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '599.9900', '599.9900', '0.0000', '0.0000', '200.0000', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, NULL, '599.9900', '599.9900', '599.9900', '599.9900', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(7, 4, NULL, 11, 1, '2011-11-23 04:28:31', '2011-11-23 04:28:31', 42, 'simple', 'a:1:{s:15:"info_buyRequest";a:3:{s:4:"uenc";s:88:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fYmxhbmtfMTYxMC9pbmRleC5waHAvZnVybml0dXJlLmh0bWw,";s:7:"product";s:2:"42";s:3:"qty";i:1;}}', '150.0000', 0, 'bar1234', 'Barcelona Bamboo Platform Bed', NULL, NULL, NULL, 0, 0, 0, NULL, '0.0000', '0.0000', '1.0000', '0.0000', '0.0000', '800.0000', '2299.0000', '2299.0000', '2299.0000', '2299.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '2299.0000', '2299.0000', '0.0000', '0.0000', '150.0000', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, NULL, '2299.0000', '2299.0000', '2299.0000', '2299.0000', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(8, 5, NULL, 12, NULL, '2011-11-24 03:18:40', '2011-11-24 03:18:40', 53, 'simple', 'a:1:{s:15:"info_buyRequest";a:3:{s:4:"uenc";s:88:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fYmxhbmtfMTYxMC9pbmRleC5waHAvZnVybml0dXJlLmh0bWw,";s:7:"product";s:2:"53";s:3:"qty";i:1;}}', '200.0000', NULL, '1113', 'Couch', NULL, '1', NULL, 0, NULL, 0, NULL, '0.0000', '0.0000', '1.0000', '0.0000', '0.0000', NULL, '599.9900', '599.9900', '599.9900', '599.9900', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '599.9900', '599.9900', '0.0000', '0.0000', '200.0000', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, NULL, '599.9900', '599.9900', '599.9900', '599.9900', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(9, 5, NULL, 13, NULL, '2011-11-24 03:18:46', '2011-11-24 03:18:46', 123, 'configurable', 'a:6:{s:15:"info_buyRequest";a:6:{s:4:"uenc";s:140:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fYmxhbmtfMTYxMC9pbmRleC5waHAvYXBwYXJlbC9zaGlydHMvdGhlLW9ubHktY2hpbGRyZW4tcGFpc2xleS10LXNoaXJ0Lmh0bWw,";s:7:"product";s:3:"123";s:15:"related_product";s:0:"";s:15:"super_attribute";a:1:{i:525;s:3:"100";}s:3:"qty";s:1:"1";s:10:"return_url";s:0:"";}s:15:"attributes_info";a:1:{i:0;a:2:{s:5:"label";s:4:"Size";s:5:"value";s:5:"Small";}}s:11:"simple_name";s:34:"The Only Children: Paisley T-Shirt";s:10:"simple_sku";s:5:"oc_sm";s:20:"product_calculations";i:1;s:13:"shipment_type";i:0;}', '0.4400', NULL, 'oc_sm', 'The Only Children: Paisley T-Shirt', NULL, '1', NULL, 0, NULL, 0, NULL, '0.0000', '0.0000', '1.0000', '0.0000', '0.0000', NULL, '110.0000', '110.0000', '110.0000', '110.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '110.0000', '110.0000', '0.0000', '0.0000', '0.4400', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, NULL, '110.0000', '110.0000', '110.0000', '110.0000', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(10, 5, 9, 14, NULL, '2011-11-24 03:18:48', '2011-11-24 03:18:48', 37, 'simple', 'a:1:{s:15:"info_buyRequest";a:6:{s:4:"uenc";s:140:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fYmxhbmtfMTYxMC9pbmRleC5waHAvYXBwYXJlbC9zaGlydHMvdGhlLW9ubHktY2hpbGRyZW4tcGFpc2xleS10LXNoaXJ0Lmh0bWw,";s:7:"product";s:3:"123";s:15:"related_product";s:0:"";s:15:"super_attribute";a:1:{i:525;s:3:"100";}s:3:"qty";s:1:"1";s:10:"return_url";s:0:"";}}', '0.4400', NULL, 'oc_sm', 'The Only Children: Paisley T-Shirt', NULL, '1', NULL, 0, NULL, 0, NULL, '0.0000', '0.0000', '1.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL),
(11, 6, NULL, 3, 1, '2012-08-22 02:10:42', '2012-08-22 02:10:42', 171, 'simple', 'a:1:{s:15:"info_buyRequest";a:3:{s:4:"uenc";s:60:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAv";s:7:"product";s:3:"171";s:3:"qty";i:1;}}', '26.0000', 0, 'Yukon FX', 'Yukon FX', NULL, NULL, NULL, 0, 0, 0, NULL, '0.0000', '0.0000', '2.0000', '0.0000', '0.0000', NULL, '136.0000', '136.0000', '136.0000', '136.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '272.0000', '272.0000', '0.0000', '0.0000', '52.0000', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, NULL, '136.0000', '136.0000', '272.0000', '272.0000', NULL, NULL, NULL, NULL, NULL, NULL, 0, NULL, NULL, NULL, NULL, NULL, NULL);

CREATE TABLE `#__sales_flat_order_status_history` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `parent_id` int(10) unsigned NOT NULL COMMENT 'Parent Id',
  `is_customer_notified` int(11) DEFAULT NULL COMMENT 'Is Customer Notified',
  `is_visible_on_front` smallint(5) unsigned NOT NULL COMMENT 'Is Visible On Front',
  `comment` text COMMENT 'Comment',
  `status` varchar(32) DEFAULT NULL COMMENT 'Status',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `entity_name` varchar(32) DEFAULT NULL COMMENT 'Shows what entity history is bind to.',
  PRIMARY KEY (`entity_id`),
  KEY `IDX_SALES_FLAT_ORDER_STATUS_HISTORY_PARENT_ID` (`parent_id`),
  KEY `IDX_SALES_FLAT_ORDER_STATUS_HISTORY_CREATED_AT` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Sales Flat Order Status History';

INSERT INTO `#__sales_flat_order_status_history` (`entity_id`, `parent_id`, `is_customer_notified`, `is_visible_on_front`, `comment`, `status`, `created_at`, `entity_name`) VALUES
(1, 1, 2, 0, 'Authorizing amount of $404.99 is pending approval on gateway. Transaction ID: "11M472365T301554E".', 'payment_review', '2011-04-06 03:37:23', NULL),
(2, 2, 1, 0, NULL, 'pending', '2011-11-09 07:36:21', 'order'),
(3, 3, 1, 0, NULL, 'pending', '2011-11-09 09:11:27', 'order'),
(4, 4, 1, 0, NULL, 'pending', '2011-11-23 04:28:32', 'order'),
(5, 5, 1, 0, NULL, 'pending', '2011-11-24 03:18:50', 'order'),
(6, 6, 1, 0, NULL, 'pending', '2012-08-22 02:10:45', 'order');

CREATE TABLE `#__sales_flat_quote_address` (
  `address_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Address Id',
  `quote_id` int(10) unsigned NOT NULL COMMENT 'Quote Id',
  `created_at` timestamp NOT NULL COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Updated At',
  `customer_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer Id',
  `save_in_address_book` smallint(6) DEFAULT '0' COMMENT 'Save In Address Book',
  `customer_address_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer Address Id',
  `address_type` varchar(255) DEFAULT NULL COMMENT 'Address Type',
  `email` varchar(255) DEFAULT NULL COMMENT 'Email',
  `prefix` varchar(40) DEFAULT NULL COMMENT 'Prefix',
  `firstname` varchar(255) DEFAULT NULL COMMENT 'Firstname',
  `middlename` varchar(40) DEFAULT NULL COMMENT 'Middlename',
  `lastname` varchar(255) DEFAULT NULL COMMENT 'Lastname',
  `suffix` varchar(40) DEFAULT NULL COMMENT 'Suffix',
  `company` varchar(255) DEFAULT NULL COMMENT 'Company',
  `street` varchar(255) DEFAULT NULL COMMENT 'Street',
  `city` varchar(255) DEFAULT NULL COMMENT 'City',
  `region` varchar(255) DEFAULT NULL COMMENT 'Region',
  `region_id` int(10) unsigned DEFAULT NULL COMMENT 'Region Id',
  `postcode` varchar(255) DEFAULT NULL COMMENT 'Postcode',
  `country_id` varchar(255) DEFAULT NULL COMMENT 'Country Id',
  `telephone` varchar(255) DEFAULT NULL COMMENT 'Telephone',
  `fax` varchar(255) DEFAULT NULL COMMENT 'Fax',
  `same_as_billing` smallint(5) unsigned NOT NULL COMMENT 'Same As Billing',
  `free_shipping` smallint(5) unsigned NOT NULL COMMENT 'Free Shipping',
  `collect_shipping_rates` smallint(5) unsigned NOT NULL COMMENT 'Collect Shipping Rates',
  `shipping_method` varchar(255) DEFAULT NULL COMMENT 'Shipping Method',
  `shipping_description` varchar(255) DEFAULT NULL COMMENT 'Shipping Description',
  `weight` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Weight',
  `subtotal` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Subtotal',
  `base_subtotal` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Subtotal',
  `subtotal_with_discount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Subtotal With Discount',
  `base_subtotal_with_discount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Subtotal With Discount',
  `tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Tax Amount',
  `base_tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Tax Amount',
  `shipping_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Shipping Amount',
  `base_shipping_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Shipping Amount',
  `shipping_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Tax Amount',
  `base_shipping_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Tax Amount',
  `discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Discount Amount',
  `base_discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Discount Amount',
  `grand_total` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Grand Total',
  `base_grand_total` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Grand Total',
  `customer_notes` text COMMENT 'Customer Notes',
  `applied_taxes` text COMMENT 'Applied Taxes',
  `gift_message_id` int(11) DEFAULT NULL COMMENT 'Gift Message Id',
  `discount_description` varchar(255) DEFAULT NULL COMMENT 'Discount Description',
  `shipping_discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Discount Amount',
  `base_shipping_discount_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Discount Amount',
  `subtotal_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Subtotal Incl Tax',
  `base_subtotal_total_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Subtotal Total Incl Tax',
  `hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Amount',
  `base_hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Hidden Tax Amount',
  `shipping_hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Hidden Tax Amount',
  `base_shipping_hidden_tax_amnt` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Hidden Tax Amount',
  `shipping_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Incl Tax',
  `base_shipping_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Shipping Incl Tax',
  `vat_id` text COMMENT 'Vat Id',
  `vat_is_valid` smallint(6) DEFAULT NULL COMMENT 'Vat Is Valid',
  `vat_request_id` text COMMENT 'Vat Request Id',
  `vat_request_date` text COMMENT 'Vat Request Date',
  `vat_request_success` smallint(6) DEFAULT NULL COMMENT 'Vat Request Success',
  PRIMARY KEY (`address_id`),
  KEY `IDX_SALES_FLAT_QUOTE_ADDRESS_QUOTE_ID` (`quote_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Sales Flat Quote Address';

INSERT INTO `#__sales_flat_quote_address` (`address_id`, `quote_id`, `created_at`, `updated_at`, `customer_id`, `save_in_address_book`, `customer_address_id`, `address_type`, `email`, `prefix`, `firstname`, `middlename`, `lastname`, `suffix`, `company`, `street`, `city`, `region`, `region_id`, `postcode`, `country_id`, `telephone`, `fax`, `same_as_billing`, `free_shipping`, `collect_shipping_rates`, `shipping_method`, `shipping_description`, `weight`, `subtotal`, `base_subtotal`, `subtotal_with_discount`, `base_subtotal_with_discount`, `tax_amount`, `base_tax_amount`, `shipping_amount`, `base_shipping_amount`, `shipping_tax_amount`, `base_shipping_tax_amount`, `discount_amount`, `base_discount_amount`, `grand_total`, `base_grand_total`, `customer_notes`, `applied_taxes`, `gift_message_id`, `discount_description`, `shipping_discount_amount`, `base_shipping_discount_amount`, `subtotal_incl_tax`, `base_subtotal_total_incl_tax`, `hidden_tax_amount`, `base_hidden_tax_amount`, `shipping_hidden_tax_amount`, `base_shipping_hidden_tax_amnt`, `shipping_incl_tax`, `base_shipping_incl_tax`, `vat_id`, `vat_is_valid`, `vat_request_id`, `vat_request_date`, `vat_request_success`) VALUES
(3, 1, '2011-04-06 03:12:59', '2011-04-06 03:37:13', 2, 1, 1, 'billing', NULL, NULL, 'Huynh', NULL, 'Hien Duc', NULL, '', 'Dan Phuong', 'Ha Noi', '', NULL, '084', 'VN', '0912939475', '', 0, 0, 0, '', '', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(4, 1, '2011-04-06 03:12:59', '2011-04-06 03:37:13', 2, 0, NULL, 'shipping', NULL, NULL, 'Huynh', NULL, 'Hien Duc', NULL, '', 'Dan Phuong', 'Ha Noi', '', NULL, '084', 'VN', '0912939475', '', 1, 0, 0, 'flatrate_flatrate', 'Flat Rate - Fixed', '13.6000', '399.9900', '399.9900', '0.0000', '0.0000', '0.0000', '0.0000', '5.0000', '5.0000', '0.0000', '0.0000', '0.0000', '0.0000', '404.9900', '404.9900', NULL, 'a:0:{}', NULL, '', '0.0000', '0.0000', '399.9900', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '5.0000', '5.0000', NULL, NULL, NULL, NULL, NULL),
(13, 2, '2011-04-06 03:54:31', '2011-04-06 04:01:20', 2, 0, 1, 'shipping', 'hienduchuynh@gmail.com', NULL, 'Huynh', NULL, 'Hien Duc', NULL, '', 'Dan Phuong', 'Ha Noi', '', NULL, '084', 'VN', '0912939475', '', 0, 0, 0, 'flatrate_flatrate', 'Flat Rate - Fixed', '0.4400', '110.0000', '110.0000', '0.0000', '0.0000', '0.0000', '0.0000', '5.0000', '5.0000', '0.0000', '0.0000', '0.0000', '0.0000', '115.0000', '115.0000', NULL, 'a:0:{}', NULL, '', '0.0000', '0.0000', '110.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '5.0000', '5.0000', NULL, NULL, NULL, NULL, NULL),
(14, 2, '2011-04-06 03:54:31', '2011-04-06 04:01:20', 2, 0, 1, 'billing', 'hienduchuynh@gmail.com', NULL, 'Huynh', NULL, 'Hien Duc', NULL, '', 'Dan Phuong', 'Ha Noi', '', NULL, '084', 'VN', '0912939475', '', 0, 0, 0, '', '', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(17, 3, '2011-11-08 04:49:23', '2011-11-08 04:52:48', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(18, 3, '2011-11-08 04:49:23', '2011-11-08 04:52:48', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '1.0000', '399.9900', '399.9900', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '399.9900', '399.9900', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '399.9900', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(21, 4, '2011-11-09 07:14:46', '2011-11-09 07:36:17', 3, 1, 2, 'billing', NULL, NULL, 'Joom', NULL, 'JoomSolutlions', NULL, NULL, 'Thanh Xuan', 'Ha Noi', NULL, NULL, '084', 'VN', '0912939475', NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(22, 4, '2011-11-09 07:14:46', '2011-11-09 07:36:17', 3, 0, NULL, 'shipping', NULL, NULL, 'Joom', NULL, 'JoomSolutlions', NULL, NULL, 'Thanh Xuan', 'Ha Noi', NULL, NULL, '084', 'VN', '0912939475', NULL, 1, 0, 0, 'flatrate_flatrate', 'Flat Rate - Fixed', '0.0000', '34.0000', '34.0000', '0.0000', '0.0000', '0.0000', '0.0000', '5.0000', '5.0000', '0.0000', '0.0000', '0.0000', '0.0000', '39.0000', '39.0000', NULL, 'a:0:{}', NULL, '12345', '0.0000', '0.0000', '34.0000', NULL, '0.0000', '0.0000', '0.0000', NULL, '5.0000', '5.0000', NULL, NULL, NULL, NULL, NULL),
(27, 5, '2011-11-09 08:43:11', '2011-11-09 09:11:30', 3, 0, 2, 'shipping', 'joom@joom.vn', NULL, 'Joom', NULL, 'JoomSolutlions', NULL, NULL, 'Thanh Xuan', 'Ha Noi', NULL, NULL, '084', 'VN', '0912939475', NULL, 1, 0, 0, 'flatrate_flatrate', 'Flat Rate - Fixed', '20.0000', '299.9900', '299.9900', '0.0000', '0.0000', '0.0000', '0.0000', '5.0000', '5.0000', '0.0000', '0.0000', '0.0000', '0.0000', '304.9900', '304.9900', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '299.9900', NULL, '0.0000', '0.0000', '0.0000', NULL, '5.0000', '5.0000', NULL, NULL, NULL, NULL, NULL),
(28, 5, '2011-11-09 08:43:11', '2011-11-09 09:11:30', 3, 0, 2, 'billing', 'joom@joom.vn', NULL, 'Joom', NULL, 'JoomSolutlions', NULL, NULL, 'Thanh Xuan', 'Ha Noi', NULL, NULL, '084', 'VN', '0912939475', NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(47, 7, '2011-11-10 09:47:34', '2011-11-10 09:49:43', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(48, 7, '2011-11-10 09:47:34', '2011-11-10 09:49:43', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '200.0000', '599.9900', '599.9900', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '599.9900', '599.9900', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '599.9900', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(55, 6, '2011-11-23 04:22:31', '2011-11-23 04:28:24', 3, 0, 2, 'billing', 'joom@joom.vn', NULL, 'Joom', NULL, 'JoomSolutlions', NULL, NULL, 'Thanh Xuan', 'Ha Noi', NULL, NULL, '084', 'VN', '0912939475', NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(56, 6, '2011-11-23 04:22:31', '2011-11-23 04:28:24', 3, 0, 2, 'shipping', 'joom@joom.vn', NULL, 'Joom', NULL, 'JoomSolutlions', NULL, NULL, 'Thanh Xuan', 'Ha Noi', NULL, NULL, '084', 'VN', '0912939475', NULL, 1, 0, 0, 'flatrate_flatrate', 'Flat Rate - Fixed', '350.5000', '2913.9900', '2913.9900', '0.0000', '0.0000', '0.0000', '0.0000', '15.0000', '15.0000', '0.0000', '0.0000', '0.0000', '0.0000', '2928.9900', '2928.9900', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '2913.9900', NULL, '0.0000', '0.0000', '0.0000', NULL, '15.0000', '15.0000', NULL, NULL, NULL, NULL, NULL),
(67, 8, '2011-11-24 03:10:25', '2011-11-24 03:18:54', 3, 0, 2, 'shipping', 'joom@joom.vn', NULL, 'Joom', NULL, 'JoomSolutlions', NULL, NULL, 'Thanh Xuan', 'Ha Noi', NULL, NULL, '084', 'VN', '0912939475', NULL, 1, 0, 0, 'flatrate_flatrate', 'Flat Rate - Fixed', '200.4400', '709.9900', '709.9900', '0.0000', '0.0000', '0.0000', '0.0000', '10.0000', '10.0000', '0.0000', '0.0000', '0.0000', '0.0000', '719.9900', '719.9900', NULL, 'a:0:{}', NULL, '12345', '0.0000', '0.0000', '709.9900', NULL, '0.0000', '0.0000', '0.0000', NULL, '10.0000', '10.0000', NULL, NULL, NULL, NULL, NULL),
(68, 8, '2011-11-24 03:10:25', '2011-11-24 03:18:54', 3, 0, 2, 'billing', 'joom@joom.vn', NULL, 'Joom', NULL, 'JoomSolutlions', NULL, NULL, 'Thanh Xuan', 'Ha Noi', NULL, NULL, '084', 'VN', '0912939475', NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(79, 10, '2012-08-13 05:26:13', '2012-08-13 05:26:13', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(80, 10, '2012-08-13 05:26:13', '2012-08-13 05:26:13', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '24.0000', '496.0000', '496.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '496.0000', '496.0000', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '496.0000', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(83, 11, '2012-08-13 07:54:09', '2012-08-13 07:56:14', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(84, 11, '2012-08-13 07:54:09', '2012-08-13 07:56:14', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '23.0000', '513.0000', '513.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '513.0000', '513.0000', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '513.0000', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(87, 12, '2012-08-14 05:00:02', '2012-08-14 05:02:28', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(88, 12, '2012-08-14 05:00:02', '2012-08-14 05:02:28', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '23.0000', '513.0000', '513.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '513.0000', '513.0000', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '513.0000', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(95, 13, '2012-08-15 03:36:43', '2012-08-15 04:09:43', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(96, 13, '2012-08-15 03:36:43', '2012-08-15 04:09:43', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '26.0000', '246.0000', '246.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '246.0000', '246.0000', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '246.0000', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(105, 14, '2012-08-15 10:11:41', '2012-08-15 10:11:55', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(106, 14, '2012-08-15 10:11:41', '2012-08-15 10:11:55', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '23.0000', '862.0000', '862.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '862.0000', '862.0000', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '862.0000', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(139, 15, '2012-08-20 07:17:07', '2012-08-20 07:17:07', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(140, 15, '2012-08-20 07:17:07', '2012-08-20 07:17:07', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '26.0000', '136.0000', '136.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '136.0000', '136.0000', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '136.0000', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(143, 16, '2012-08-20 07:42:34', '2012-08-20 07:42:34', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(144, 16, '2012-08-20 07:42:34', '2012-08-20 07:42:34', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '25.0000', '356.9900', '356.9900', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '356.9900', '356.9900', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '356.9900', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(147, 17, '2012-08-20 07:44:12', '2012-08-20 07:44:35', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(148, 17, '2012-08-20 07:44:12', '2012-08-20 07:44:35', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '26.0000', '136.0000', '136.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '136.0000', '136.0000', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '136.0000', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(151, 9, '2012-08-22 02:09:55', '2012-08-22 02:10:41', 3, 0, 2, 'billing', 'joom@joom.vn', NULL, 'Joom', NULL, 'JoomSolutlions', NULL, NULL, 'Thanh Xuan', 'Ha Noi', NULL, NULL, '084', 'VN', '0912939475', NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(152, 9, '2012-08-22 02:09:55', '2012-08-22 02:10:41', 3, 0, 2, 'shipping', 'joom@joom.vn', NULL, 'Joom', NULL, 'JoomSolutlions', NULL, NULL, 'Thanh Xuan', 'Ha Noi', NULL, NULL, '084', 'VN', '0912939475', NULL, 1, 0, 0, 'flatrate_flatrate', 'Flat Rate - Fixed', '52.0000', '272.0000', '272.0000', '0.0000', '0.0000', '0.0000', '0.0000', '10.0000', '10.0000', '0.0000', '0.0000', '0.0000', '0.0000', '282.0000', '282.0000', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '272.0000', NULL, '0.0000', '0.0000', '0.0000', NULL, '10.0000', '10.0000', NULL, NULL, NULL, NULL, NULL),
(171, 20, '2012-08-24 02:12:15', '2012-08-24 02:12:15', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(172, 20, '2012-08-24 02:12:15', '2012-08-24 02:12:15', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '26.0000', '136.0000', '136.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '136.0000', '136.0000', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '136.0000', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(175, 21, '2012-08-24 03:11:43', '2012-08-24 03:11:43', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(176, 21, '2012-08-24 03:11:43', '2012-08-24 03:11:43', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '25.0000', '356.9900', '356.9900', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '356.9900', '356.9900', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '356.9900', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(179, 22, '2012-08-24 08:54:05', '2012-08-24 08:54:05', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(180, 22, '2012-08-24 08:54:05', '2012-08-24 08:54:05', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '25.0000', '356.9900', '356.9900', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '356.9900', '356.9900', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '356.9900', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(185, 23, '2012-08-25 04:03:30', '2012-08-25 04:27:42', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(186, 23, '2012-08-25 04:03:30', '2012-08-25 04:27:42', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '26.0000', '136.0000', '136.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '136.0000', '136.0000', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '136.0000', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(189, 24, '2012-08-25 04:06:36', '2012-08-25 04:26:06', NULL, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(190, 24, '2012-08-25 04:06:36', '2012-08-25 04:26:06', NULL, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '23.0000', '513.0000', '513.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '513.0000', '513.0000', NULL, 'a:0:{}', NULL, NULL, '0.0000', '0.0000', '513.0000', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(201, 18, '2012-08-25 09:08:39', '2012-08-25 09:48:36', 3, 0, NULL, 'billing', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, NULL, NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', NULL, 'a:0:{}', NULL, NULL, NULL, NULL, '0.0000', NULL, NULL, NULL, NULL, NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL),
(202, 18, '2012-08-25 09:08:39', '2012-08-25 09:48:36', 3, 0, NULL, 'shipping', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 1, 0, 0, NULL, NULL, '143.0000', '3745.9900', '3745.9900', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '3745.9900', '3745.9900', NULL, 'a:0:{}', NULL, '12345', '0.0000', '0.0000', '3745.9900', NULL, '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', NULL, NULL, NULL, NULL, NULL);

CREATE TABLE `#__sales_flat_quote_address_item` (
  `address_item_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Address Item Id',
  `parent_item_id` int(10) unsigned DEFAULT NULL COMMENT 'Parent Item Id',
  `quote_address_id` int(10) unsigned NOT NULL COMMENT 'Quote Address Id',
  `quote_item_id` int(10) unsigned NOT NULL COMMENT 'Quote Item Id',
  `created_at` timestamp NOT NULL COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Updated At',
  `applied_rule_ids` text COMMENT 'Applied Rule Ids',
  `additional_data` text COMMENT 'Additional Data',
  `weight` decimal(12,4) DEFAULT '0.0000' COMMENT 'Weight',
  `qty` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Qty',
  `discount_amount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Discount Amount',
  `tax_amount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Tax Amount',
  `row_total` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Row Total',
  `base_row_total` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Row Total',
  `row_total_with_discount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Row Total With Discount',
  `base_discount_amount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Base Discount Amount',
  `base_tax_amount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Base Tax Amount',
  `row_weight` decimal(12,4) DEFAULT '0.0000' COMMENT 'Row Weight',
  `gift_message_id` int(11) DEFAULT NULL COMMENT 'Gift Message Id',
  `base_cost` decimal(12,4) DEFAULT NULL COMMENT 'Base Cost',
  `price_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Price Incl Tax',
  `base_price_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Price Incl Tax',
  `row_total_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Row Total Incl Tax',
  `base_row_total_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Row Total Incl Tax',
  `hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Amount',
  `base_hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Hidden Tax Amount',
  PRIMARY KEY (`address_item_id`),
  KEY `IDX_SALES_FLAT_QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS_ID` (`quote_address_id`),
  KEY `IDX_SALES_FLAT_QUOTE_ADDRESS_ITEM_PARENT_ITEM_ID` (`parent_item_id`),
  KEY `IDX_SALES_FLAT_QUOTE_ADDRESS_ITEM_QUOTE_ITEM_ID` (`quote_item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Quote Address Item';


CREATE TABLE `#__sales_flat_quote_item` (
  `item_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Item Id',
  `quote_id` int(10) unsigned NOT NULL COMMENT 'Quote Id',
  `created_at` timestamp NOT NULL COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Updated At',
  `product_id` int(10) unsigned DEFAULT NULL COMMENT 'Product Id',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `parent_item_id` int(10) unsigned DEFAULT NULL COMMENT 'Parent Item Id',
  `is_virtual` smallint(5) unsigned DEFAULT NULL COMMENT 'Is Virtual',
  `sku` varchar(255) DEFAULT NULL COMMENT 'Sku',
  `name` varchar(255) DEFAULT NULL COMMENT 'Name',
  `description` text COMMENT 'Description',
  `applied_rule_ids` text COMMENT 'Applied Rule Ids',
  `additional_data` text COMMENT 'Additional Data',
  `free_shipping` smallint(5) unsigned NOT NULL COMMENT 'Free Shipping',
  `is_qty_decimal` smallint(5) unsigned DEFAULT NULL COMMENT 'Is Qty Decimal',
  `no_discount` smallint(5) unsigned DEFAULT '0' COMMENT 'No Discount',
  `weight` decimal(12,4) DEFAULT '0.0000' COMMENT 'Weight',
  `qty` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Qty',
  `price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Price',
  `base_price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Price',
  `custom_price` decimal(12,4) DEFAULT NULL COMMENT 'Custom Price',
  `discount_percent` decimal(12,4) DEFAULT '0.0000' COMMENT 'Discount Percent',
  `discount_amount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Discount Amount',
  `base_discount_amount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Base Discount Amount',
  `tax_percent` decimal(12,4) DEFAULT '0.0000' COMMENT 'Tax Percent',
  `tax_amount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Tax Amount',
  `base_tax_amount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Base Tax Amount',
  `row_total` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Row Total',
  `base_row_total` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Base Row Total',
  `row_total_with_discount` decimal(12,4) DEFAULT '0.0000' COMMENT 'Row Total With Discount',
  `row_weight` decimal(12,4) DEFAULT '0.0000' COMMENT 'Row Weight',
  `product_type` varchar(255) DEFAULT NULL COMMENT 'Product Type',
  `base_tax_before_discount` decimal(12,4) DEFAULT NULL COMMENT 'Base Tax Before Discount',
  `tax_before_discount` decimal(12,4) DEFAULT NULL COMMENT 'Tax Before Discount',
  `original_custom_price` decimal(12,4) DEFAULT NULL COMMENT 'Original Custom Price',
  `gift_message_id` int(11) DEFAULT NULL COMMENT 'Gift Message Id',
  `weee_tax_applied` text COMMENT 'Weee Tax Applied',
  `weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Amount',
  `weee_tax_applied_row_amount` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Applied Row Amount',
  `base_weee_tax_applied_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Amount',
  `base_weee_tax_applied_row_amnt` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Applied Row Amnt',
  `weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Disposition',
  `weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Weee Tax Row Disposition',
  `base_weee_tax_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Disposition',
  `base_weee_tax_row_disposition` decimal(12,4) DEFAULT NULL COMMENT 'Base Weee Tax Row Disposition',
  `redirect_url` varchar(255) DEFAULT NULL COMMENT 'Redirect Url',
  `base_cost` decimal(12,4) DEFAULT NULL COMMENT 'Base Cost',
  `price_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Price Incl Tax',
  `base_price_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Price Incl Tax',
  `row_total_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Row Total Incl Tax',
  `base_row_total_incl_tax` decimal(12,4) DEFAULT NULL COMMENT 'Base Row Total Incl Tax',
  `hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Hidden Tax Amount',
  `base_hidden_tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Hidden Tax Amount',
  PRIMARY KEY (`item_id`),
  KEY `j502fa_FK_FK_SALES_QUOTE_ITEM_STORE` (`store_id`),
  KEY `IDX_SALES_FLAT_QUOTE_ITEM_PARENT_ITEM_ID` (`parent_item_id`),
  KEY `IDX_SALES_FLAT_QUOTE_ITEM_PRODUCT_ID` (`product_id`),
  KEY `IDX_SALES_FLAT_QUOTE_ITEM_QUOTE_ID` (`quote_id`),
  KEY `IDX_SALES_FLAT_QUOTE_ITEM_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Sales Flat Quote Item';

INSERT INTO `#__sales_flat_quote_item` (`item_id`, `quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `parent_item_id`, `is_virtual`, `sku`, `name`, `description`, `applied_rule_ids`, `additional_data`, `free_shipping`, `is_qty_decimal`, `no_discount`, `weight`, `qty`, `price`, `base_price`, `custom_price`, `discount_percent`, `discount_amount`, `base_discount_amount`, `tax_percent`, `tax_amount`, `base_tax_amount`, `row_total`, `base_row_total`, `row_total_with_discount`, `row_weight`, `product_type`, `base_tax_before_discount`, `tax_before_discount`, `original_custom_price`, `gift_message_id`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `redirect_url`, `base_cost`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `hidden_tax_amount`, `base_hidden_tax_amount`) VALUES
(3, 9, '2012-08-10 04:00:24', '2012-08-16 03:25:46', 171, 1, NULL, 0, 'Yukon FX', 'Yukon FX', NULL, NULL, NULL, 0, 0, 0, '26.0000', '2.0000', '136.0000', '136.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '272.0000', '272.0000', '0.0000', '52.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '136.0000', '136.0000', '272.0000', '272.0000', NULL, NULL),
(4, 10, '2012-08-13 05:26:09', '2012-08-13 05:26:09', 170, 1, NULL, 0, 'ExpressWay', 'ExpressWay', NULL, NULL, NULL, 0, 0, 0, '24.0000', '1.0000', '496.0000', '496.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '496.0000', '496.0000', '0.0000', '24.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '496.0000', '496.0000', '496.0000', '496.0000', NULL, NULL),
(5, 11, '2012-08-13 07:54:06', '2012-08-13 07:54:06', 173, 1, NULL, 0, 'Suede W', 'Suede W', NULL, NULL, NULL, 0, 0, 0, '23.0000', '1.0000', '513.0000', '513.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '513.0000', '513.0000', '0.0000', '23.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '513.0000', '513.0000', '513.0000', '513.0000', NULL, NULL),
(6, 12, '2012-08-14 04:59:59', '2012-08-14 04:59:59', 173, 1, NULL, 0, 'Suede W', 'Suede W', NULL, NULL, NULL, 0, 0, 0, '23.0000', '1.0000', '513.0000', '513.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '513.0000', '513.0000', '0.0000', '23.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '513.0000', '513.0000', '513.0000', '513.0000', NULL, NULL),
(7, 13, '2012-08-15 03:36:40', '2012-08-15 03:36:40', 178, 1, NULL, 0, 'Accend', 'Accend', NULL, NULL, NULL, 0, 0, 0, '26.0000', '1.0000', '246.0000', '246.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '246.0000', '246.0000', '0.0000', '26.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '246.0000', '246.0000', '246.0000', '246.0000', NULL, NULL),
(8, 14, '2012-08-15 10:11:38', '2012-08-15 10:11:38', 180, 1, NULL, 0, 'Madone 4 ', 'Madone 4 ', NULL, NULL, NULL, 0, 0, 0, '23.0000', '1.0000', '862.0000', '862.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '862.0000', '862.0000', '0.0000', '23.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '862.0000', '862.0000', '862.0000', '862.0000', NULL, NULL),
(9, 15, '2012-08-20 07:17:04', '2012-08-20 07:17:04', 171, 1, NULL, 0, 'Yukon FX', 'Yukon FX', NULL, NULL, NULL, 0, 0, 0, '26.0000', '1.0000', '136.0000', '136.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '136.0000', '136.0000', '0.0000', '26.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '136.0000', '136.0000', '136.0000', '136.0000', NULL, NULL),
(10, 16, '2012-08-20 07:42:31', '2012-08-20 07:42:31', 169, 1, NULL, 0, 'Talon 29er', 'Talon 29er', NULL, NULL, NULL, 0, 0, 0, '25.0000', '1.0000', '356.9900', '356.9900', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '356.9900', '356.9900', '0.0000', '25.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '356.9900', '356.9900', '356.9900', '356.9900', NULL, NULL),
(11, 17, '2012-08-20 07:44:09', '2012-08-20 07:44:09', 171, 1, NULL, 0, 'Yukon FX', 'Yukon FX', NULL, NULL, NULL, 0, 0, 0, '26.0000', '1.0000', '136.0000', '136.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '136.0000', '136.0000', '0.0000', '26.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '136.0000', '136.0000', '136.0000', '136.0000', NULL, NULL),
(12, 18, '2012-08-22 03:30:13', '2012-08-23 02:15:26', 179, 1, NULL, 0, 'Revel W', 'Revel W', NULL, '1', NULL, 0, 0, 0, '26.0000', '1.0000', '639.0000', '639.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '639.0000', '639.0000', '0.0000', '26.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '639.0000', '639.0000', '639.0000', '639.0000', NULL, NULL),
(13, 18, '2012-08-23 03:54:26', '2012-08-24 04:26:41', 173, 1, NULL, 0, 'Suede W', 'Suede W', NULL, '1', NULL, 0, 0, 0, '23.0000', '2.0000', '513.0000', '513.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '1026.0000', '1026.0000', '0.0000', '46.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '513.0000', '513.0000', '1026.0000', '1026.0000', NULL, NULL),
(15, 20, '2012-08-24 02:12:12', '2012-08-24 02:12:12', 171, 1, NULL, 0, 'Yukon FX', 'Yukon FX', NULL, NULL, NULL, 0, 0, 0, '26.0000', '1.0000', '136.0000', '136.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '136.0000', '136.0000', '0.0000', '26.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '136.0000', '136.0000', '136.0000', '136.0000', NULL, NULL),
(16, 21, '2012-08-24 03:11:36', '2012-08-24 03:11:36', 169, 1, NULL, 0, 'Talon 29er', 'Talon 29er', NULL, NULL, NULL, 0, 0, 0, '25.0000', '1.0000', '356.9900', '356.9900', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '356.9900', '356.9900', '0.0000', '25.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '356.9900', '356.9900', '356.9900', '356.9900', NULL, NULL),
(17, 18, '2012-08-24 01:57:03', '2012-08-24 03:28:31', 169, 1, NULL, 0, 'Talon 29er', 'Talon 29er', NULL, '1', NULL, 0, 0, 0, '25.0000', '1.0000', '356.9900', '356.9900', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '356.9900', '356.9900', '0.0000', '25.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '356.9900', '356.9900', '356.9900', '356.9900', NULL, NULL),
(18, 18, '2012-08-24 04:26:41', '2012-08-24 04:26:41', 180, 1, NULL, 0, 'Madone 4 ', 'Madone 4 ', NULL, '1', NULL, 0, 0, 0, '23.0000', '2.0000', '862.0000', '862.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '1724.0000', '1724.0000', '0.0000', '46.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '862.0000', '862.0000', '1724.0000', '1724.0000', NULL, NULL),
(19, 22, '2012-08-24 08:54:02', '2012-08-24 08:54:02', 169, 1, NULL, 0, 'Talon 29er', 'Talon 29er', NULL, NULL, NULL, 0, 0, 0, '25.0000', '1.0000', '356.9900', '356.9900', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '356.9900', '356.9900', '0.0000', '25.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '356.9900', '356.9900', '356.9900', '356.9900', NULL, NULL),
(20, 23, '2012-08-25 04:03:26', '2012-08-25 04:03:26', 171, 1, NULL, 0, 'Yukon FX', 'Yukon FX', NULL, NULL, NULL, 0, 0, 0, '26.0000', '1.0000', '136.0000', '136.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '136.0000', '136.0000', '0.0000', '26.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '136.0000', '136.0000', '136.0000', '136.0000', NULL, NULL),
(21, 24, '2012-08-25 04:06:34', '2012-08-25 04:06:34', 173, 1, NULL, 0, 'Suede W', 'Suede W', NULL, NULL, NULL, 0, 0, 0, '23.0000', '1.0000', '513.0000', '513.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '0.0000', '513.0000', '513.0000', '0.0000', '23.0000', 'simple', NULL, NULL, NULL, NULL, 'a:0:{}', '0.0000', '0.0000', '0.0000', NULL, '0.0000', '0.0000', '0.0000', '0.0000', NULL, NULL, '513.0000', '513.0000', '513.0000', '513.0000', NULL, NULL);

CREATE TABLE `#__sales_flat_quote_item_option` (
  `option_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Option Id',
  `item_id` int(10) unsigned NOT NULL COMMENT 'Item Id',
  `product_id` int(10) unsigned NOT NULL COMMENT 'Product Id',
  `code` varchar(255) NOT NULL COMMENT 'Code',
  `value` text COMMENT 'Value',
  PRIMARY KEY (`option_id`),
  KEY `IDX_SALES_FLAT_QUOTE_ITEM_OPTION_ITEM_ID` (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Sales Flat Quote Item Option';

INSERT INTO `#__sales_flat_quote_item_option` (`option_id`, `item_id`, `product_id`, `code`, `value`) VALUES
(3, 3, 171, 'info_buyRequest', 'a:3:{s:4:"uenc";s:60:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAv";s:7:"product";s:3:"171";s:3:"qty";i:1;}'),
(4, 4, 170, 'info_buyRequest', 'a:3:{s:4:"uenc";s:48:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC8,";s:7:"product";s:3:"170";s:3:"qty";i:1;}'),
(5, 5, 173, 'info_buyRequest', 'a:3:{s:4:"uenc";s:60:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAv";s:7:"product";s:3:"173";s:3:"qty";i:1;}'),
(6, 6, 173, 'info_buyRequest', 'a:3:{s:4:"uenc";s:60:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAv";s:7:"product";s:3:"173";s:3:"qty";i:1;}'),
(7, 7, 178, 'info_buyRequest', 'a:4:{s:4:"uenc";s:84:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAvYmlrZXMvYWNjZW5kLmh0bWw,";s:7:"product";s:3:"178";s:15:"related_product";s:0:"";s:3:"qty";s:1:"1";}'),
(8, 8, 180, 'info_buyRequest', 'a:4:{s:4:"uenc";s:92:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAvZ2VhcnMvYmFncy9tYWRvbmUtNC5odG1s";s:7:"product";s:3:"180";s:15:"related_product";s:0:"";s:3:"qty";s:1:"1";}'),
(9, 9, 171, 'info_buyRequest', 'a:3:{s:4:"uenc";s:48:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC8,";s:7:"product";s:3:"171";s:3:"qty";i:1;}'),
(10, 10, 169, 'info_buyRequest', 'a:3:{s:4:"uenc";s:88:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAvZ2VhcnMvY29tcHV0ZXJzLmh0bWw,";s:7:"product";s:3:"169";s:3:"qty";i:1;}'),
(11, 11, 171, 'info_buyRequest', 'a:3:{s:4:"uenc";s:60:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAv";s:7:"product";s:3:"171";s:3:"qty";i:1;}'),
(12, 12, 179, 'info_buyRequest', 'a:3:{s:4:"uenc";s:76:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAvYmlrZXMuaHRtbA,,";s:7:"product";s:3:"179";s:3:"qty";i:1;}'),
(13, 13, 173, 'info_buyRequest', 'a:6:{s:7:"product";s:3:"173";s:15:"related_product";s:0:"";s:7:"options";a:1:{i:1;s:1:"1";}s:3:"qty";d:1;s:10:"return_url";s:0:"";s:12:"original_qty";s:1:"1";}'),
(14, 13, 173, 'option_ids', '1'),
(15, 13, 173, 'option_1', '1'),
(17, 15, 171, 'info_buyRequest', 'a:3:{s:4:"uenc";s:60:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAv";s:7:"product";s:3:"171";s:3:"qty";i:1;}'),
(18, 16, 169, 'info_buyRequest', 'a:5:{s:4:"uenc";s:96:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAvYmlrZXMvbWVuL3RhbG9uLTI5ZXIuaHRtbA,,";s:7:"product";s:3:"169";s:15:"related_product";s:0:"";s:3:"qty";s:1:"1";s:10:"return_url";s:66:"http://10.0.0.102/jm_works/jm_trex/index.php/paypal/express/start/";}'),
(19, 17, 169, 'info_buyRequest', 'a:3:{s:4:"uenc";s:88:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAvYmlrZXMuaHRtbD9tb2RlPWxpc3Q,";s:7:"product";s:3:"169";s:3:"qty";i:1;}'),
(20, 18, 180, 'info_buyRequest', 'a:3:{s:7:"product";s:3:"180";s:12:"original_qty";N;s:3:"qty";d:2;}'),
(21, 19, 169, 'info_buyRequest', 'a:3:{s:4:"uenc";s:48:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC8,";s:7:"product";s:3:"169";s:3:"qty";i:1;}'),
(22, 20, 171, 'info_buyRequest', 'a:5:{s:4:"uenc";s:80:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAveXVrb24tZnguaHRtbA,,";s:7:"product";s:3:"171";s:15:"related_product";s:0:"";s:3:"qty";s:1:"1";s:10:"return_url";s:0:"";}'),
(23, 21, 173, 'info_buyRequest', 'a:6:{s:4:"uenc";s:96:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAvc3VlZGUtdy5odG1sP29wdGlvbnM9Y2FydA,,";s:7:"product";s:3:"173";s:15:"related_product";s:0:"";s:7:"options";a:1:{i:1;s:1:"1";}s:3:"qty";s:1:"1";s:10:"return_url";s:0:"";}'),
(24, 21, 173, 'option_ids', '1'),
(25, 21, 173, 'option_1', '1');

CREATE TABLE `#__sales_flat_quote_shipping_rate` (
  `rate_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rate Id',
  `address_id` int(10) unsigned NOT NULL COMMENT 'Address Id',
  `created_at` timestamp NOT NULL COMMENT 'Created At',
  `updated_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Updated At',
  `carrier` varchar(255) DEFAULT NULL COMMENT 'Carrier',
  `carrier_title` varchar(255) DEFAULT NULL COMMENT 'Carrier Title',
  `code` varchar(255) DEFAULT NULL COMMENT 'Code',
  `method` varchar(255) DEFAULT NULL COMMENT 'Method',
  `method_description` text COMMENT 'Method Description',
  `price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Price',
  `method_title` text COMMENT 'Method Title',
  PRIMARY KEY (`rate_id`),
  KEY `IDX_SALES_FLAT_QUOTE_SHIPPING_RATE_ADDRESS_ID` (`address_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Sales Flat Quote Shipping Rate';

INSERT INTO `#__sales_flat_quote_shipping_rate` (`rate_id`, `address_id`, `created_at`, `updated_at`, `carrier`, `carrier_title`, `code`, `method`, `method_description`, `price`, `method_title`) VALUES
(4, 4, '2011-04-06 03:36:55', '2011-04-06 03:37:14', 'flatrate', 'Flat Rate', 'flatrate_flatrate', 'flatrate', NULL, '5.0000', 'Fixed'),
(13, 8, '2011-04-06 03:54:13', '2011-04-06 03:54:19', 'flatrate', 'Flat Rate', 'flatrate_flatrate', 'flatrate', NULL, '5.0000', 'Fixed'),
(15, 13, '2011-04-06 04:00:52', '2011-04-06 04:01:20', 'flatrate', 'Flat Rate', 'flatrate_flatrate', 'flatrate', NULL, '5.0000', 'Fixed'),
(20, 22, '2011-11-09 07:32:33', '2011-11-09 07:36:17', 'flatrate', 'Flat Rate', 'flatrate_flatrate', 'flatrate', NULL, '5.0000', 'Fixed'),
(28, 27, '2011-11-09 09:06:16', '2011-11-09 09:11:30', 'flatrate', 'Flat Rate', 'flatrate_flatrate', 'flatrate', NULL, '5.0000', 'Fixed'),
(31, 56, '2011-11-23 04:28:12', '2011-11-23 04:28:24', 'flatrate', 'Flat Rate', 'flatrate_flatrate', 'flatrate', NULL, '15.0000', 'Fixed'),
(33, 67, '2011-11-24 03:10:47', '2011-11-24 03:18:54', 'flatrate', 'Flat Rate', 'flatrate_flatrate', 'flatrate', NULL, '10.0000', 'Fixed'),
(36, 152, '2012-08-22 02:10:35', '2012-08-22 02:10:41', 'flatrate', 'Flat Rate', 'flatrate_flatrate', 'flatrate', NULL, '10.0000', 'Fixed');

CREATE TABLE `#__sales_flat_shipment` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `total_weight` decimal(12,4) DEFAULT NULL COMMENT 'Total Weight',
  `total_qty` decimal(12,4) DEFAULT NULL COMMENT 'Total Qty',
  `email_sent` smallint(5) unsigned DEFAULT NULL COMMENT 'Email Sent',
  `order_id` int(10) unsigned NOT NULL COMMENT 'Order Id',
  `customer_id` int(11) DEFAULT NULL COMMENT 'Customer Id',
  `shipping_address_id` int(11) DEFAULT NULL COMMENT 'Shipping Address Id',
  `billing_address_id` int(11) DEFAULT NULL COMMENT 'Billing Address Id',
  `shipment_status` int(11) DEFAULT NULL COMMENT 'Shipment Status',
  `increment_id` varchar(50) DEFAULT NULL COMMENT 'Increment Id',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  `packages` text COMMENT 'Packed Products in Packages',
  `shipping_label` mediumblob COMMENT 'Shipping Label Content',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `UNQ_SALES_FLAT_SHIPMENT_INCREMENT_ID` (`increment_id`),
  KEY `IDX_SALES_FLAT_SHIPMENT_STORE_ID` (`store_id`),
  KEY `IDX_SALES_FLAT_SHIPMENT_TOTAL_QTY` (`total_qty`),
  KEY `IDX_SALES_FLAT_SHIPMENT_ORDER_ID` (`order_id`),
  KEY `IDX_SALES_FLAT_SHIPMENT_CREATED_AT` (`created_at`),
  KEY `IDX_SALES_FLAT_SHIPMENT_UPDATED_AT` (`updated_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Shipment';


CREATE TABLE `#__sales_flat_shipment_comment` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `parent_id` int(10) unsigned NOT NULL COMMENT 'Parent Id',
  `is_customer_notified` int(11) DEFAULT NULL COMMENT 'Is Customer Notified',
  `is_visible_on_front` smallint(5) unsigned NOT NULL COMMENT 'Is Visible On Front',
  `comment` text COMMENT 'Comment',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  PRIMARY KEY (`entity_id`),
  KEY `IDX_SALES_FLAT_SHIPMENT_COMMENT_CREATED_AT` (`created_at`),
  KEY `IDX_SALES_FLAT_SHIPMENT_COMMENT_PARENT_ID` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Shipment Comment';


CREATE TABLE `#__sales_flat_shipment_grid` (
  `entity_id` int(10) unsigned NOT NULL COMMENT 'Entity Id',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `total_qty` decimal(12,4) DEFAULT NULL COMMENT 'Total Qty',
  `order_id` int(10) unsigned NOT NULL COMMENT 'Order Id',
  `shipment_status` int(11) DEFAULT NULL COMMENT 'Shipment Status',
  `increment_id` varchar(50) DEFAULT NULL COMMENT 'Increment Id',
  `order_increment_id` varchar(50) DEFAULT NULL COMMENT 'Order Increment Id',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `order_created_at` timestamp NULL DEFAULT NULL COMMENT 'Order Created At',
  `shipping_name` varchar(255) DEFAULT NULL COMMENT 'Shipping Name',
  PRIMARY KEY (`entity_id`),
  UNIQUE KEY `UNQ_SALES_FLAT_SHIPMENT_GRID_INCREMENT_ID` (`increment_id`),
  KEY `IDX_SALES_FLAT_SHIPMENT_GRID_STORE_ID` (`store_id`),
  KEY `IDX_SALES_FLAT_SHIPMENT_GRID_TOTAL_QTY` (`total_qty`),
  KEY `IDX_SALES_FLAT_SHIPMENT_GRID_ORDER_ID` (`order_id`),
  KEY `IDX_SALES_FLAT_SHIPMENT_GRID_SHIPMENT_STATUS` (`shipment_status`),
  KEY `IDX_SALES_FLAT_SHIPMENT_GRID_ORDER_INCREMENT_ID` (`order_increment_id`),
  KEY `IDX_SALES_FLAT_SHIPMENT_GRID_CREATED_AT` (`created_at`),
  KEY `IDX_SALES_FLAT_SHIPMENT_GRID_ORDER_CREATED_AT` (`order_created_at`),
  KEY `IDX_SALES_FLAT_SHIPMENT_GRID_SHIPPING_NAME` (`shipping_name`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Shipment Grid';


CREATE TABLE `#__sales_flat_shipment_item` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `parent_id` int(10) unsigned NOT NULL COMMENT 'Parent Id',
  `row_total` decimal(12,4) DEFAULT NULL COMMENT 'Row Total',
  `price` decimal(12,4) DEFAULT NULL COMMENT 'Price',
  `weight` decimal(12,4) DEFAULT NULL COMMENT 'Weight',
  `qty` decimal(12,4) DEFAULT NULL COMMENT 'Qty',
  `product_id` int(11) DEFAULT NULL COMMENT 'Product Id',
  `order_item_id` int(11) DEFAULT NULL COMMENT 'Order Item Id',
  `additional_data` text COMMENT 'Additional Data',
  `description` text COMMENT 'Description',
  `name` varchar(255) DEFAULT NULL COMMENT 'Name',
  `sku` varchar(255) DEFAULT NULL COMMENT 'Sku',
  PRIMARY KEY (`entity_id`),
  KEY `IDX_SALES_FLAT_SHIPMENT_ITEM_PARENT_ID` (`parent_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Shipment Item';


CREATE TABLE `#__sales_flat_shipment_track` (
  `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
  `parent_id` int(10) unsigned NOT NULL COMMENT 'Parent Id',
  `weight` decimal(12,4) DEFAULT NULL COMMENT 'Weight',
  `qty` decimal(12,4) DEFAULT NULL COMMENT 'Qty',
  `order_id` int(10) unsigned NOT NULL COMMENT 'Order Id',
  `track_number` text COMMENT 'Number',
  `description` text COMMENT 'Description',
  `title` varchar(255) DEFAULT NULL COMMENT 'Title',
  `carrier_code` varchar(32) DEFAULT NULL COMMENT 'Carrier Code',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  PRIMARY KEY (`entity_id`),
  KEY `IDX_SALES_FLAT_SHIPMENT_TRACK_PARENT_ID` (`parent_id`),
  KEY `IDX_SALES_FLAT_SHIPMENT_TRACK_ORDER_ID` (`order_id`),
  KEY `IDX_SALES_FLAT_SHIPMENT_TRACK_CREATED_AT` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Flat Shipment Track';


CREATE TABLE `#__sales_invoiced_aggregated` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `order_status` varchar(50) DEFAULT NULL COMMENT 'Order Status',
  `orders_count` int(11) NOT NULL COMMENT 'Orders Count',
  `orders_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Orders Invoiced',
  `invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Invoiced',
  `invoiced_captured` decimal(12,4) DEFAULT NULL COMMENT 'Invoiced Captured',
  `invoiced_not_captured` decimal(12,4) DEFAULT NULL COMMENT 'Invoiced Not Captured',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_SALES_INVOICED_AGGREGATED_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  KEY `IDX_SALES_INVOICED_AGGREGATED_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Invoiced Aggregated';


CREATE TABLE `#__sales_invoiced_aggregated_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `order_status` varchar(50) NOT NULL COMMENT 'Order Status',
  `orders_count` int(11) NOT NULL COMMENT 'Orders Count',
  `orders_invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Orders Invoiced',
  `invoiced` decimal(12,4) DEFAULT NULL COMMENT 'Invoiced',
  `invoiced_captured` decimal(12,4) DEFAULT NULL COMMENT 'Invoiced Captured',
  `invoiced_not_captured` decimal(12,4) DEFAULT NULL COMMENT 'Invoiced Not Captured',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_SALES_INVOICED_AGGREGATED_ORDER_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  KEY `IDX_SALES_INVOICED_AGGREGATED_ORDER_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Invoiced Aggregated Order';


CREATE TABLE `#__sales_order_aggregated_created` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `order_status` varchar(50) NOT NULL COMMENT 'Order Status',
  `orders_count` int(11) NOT NULL COMMENT 'Orders Count',
  `total_qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Qty Ordered',
  `total_qty_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Qty Invoiced',
  `total_income_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Income Amount',
  `total_revenue_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Revenue Amount',
  `total_profit_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Profit Amount',
  `total_invoiced_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Invoiced Amount',
  `total_canceled_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Canceled Amount',
  `total_paid_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Paid Amount',
  `total_refunded_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Refunded Amount',
  `total_tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Tax Amount',
  `total_tax_amount_actual` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Tax Amount Actual',
  `total_shipping_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Shipping Amount',
  `total_shipping_amount_actual` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Shipping Amount Actual',
  `total_discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Discount Amount',
  `total_discount_amount_actual` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Discount Amount Actual',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_SALES_ORDER_AGGREGATED_CREATED_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  KEY `IDX_SALES_ORDER_AGGREGATED_CREATED_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Order Aggregated Created';


CREATE TABLE `#__sales_order_aggregated_updated` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `order_status` varchar(50) NOT NULL COMMENT 'Order Status',
  `orders_count` int(11) NOT NULL COMMENT 'Orders Count',
  `total_qty_ordered` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Qty Ordered',
  `total_qty_invoiced` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Qty Invoiced',
  `total_income_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Income Amount',
  `total_revenue_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Revenue Amount',
  `total_profit_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Profit Amount',
  `total_invoiced_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Invoiced Amount',
  `total_canceled_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Canceled Amount',
  `total_paid_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Paid Amount',
  `total_refunded_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Refunded Amount',
  `total_tax_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Tax Amount',
  `total_tax_amount_actual` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Tax Amount Actual',
  `total_shipping_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Shipping Amount',
  `total_shipping_amount_actual` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Shipping Amount Actual',
  `total_discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Discount Amount',
  `total_discount_amount_actual` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Total Discount Amount Actual',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_SALES_ORDER_AGGREGATED_UPDATED_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  KEY `IDX_SALES_ORDER_AGGREGATED_UPDATED_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Order Aggregated Updated';


CREATE TABLE `#__sales_order_status` (
  `status` varchar(32) NOT NULL COMMENT 'Status',
  `label` varchar(128) NOT NULL COMMENT 'Label',
  PRIMARY KEY (`status`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Order Status Table';

INSERT INTO `#__sales_order_status` (`status`, `label`) VALUES
('canceled', 'Canceled'),
('closed', 'Closed'),
('complete', 'Complete'),
('fraud', 'Suspected Fraud'),
('holded', 'On Hold'),
('payment_review', 'Payment Review'),
('paypal_canceled_reversal', 'PayPal Canceled Reversal'),
('paypal_reversed', 'PayPal Reversed'),
('pending', 'Pending'),
('pending_payment', 'Pending Payment'),
('pending_paypal', 'Pending PayPal'),
('processing', 'Processing');

CREATE TABLE `#__sales_order_status_label` (
  `status` varchar(32) NOT NULL COMMENT 'Status',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store Id',
  `label` varchar(128) NOT NULL COMMENT 'Label',
  PRIMARY KEY (`status`,`store_id`),
  KEY `j502fa_FK_SALES_ORDER_STATUS_LABEL_STORE` (`store_id`),
  KEY `IDX_SALES_ORDER_STATUS_LABEL_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Order Status Label Table';


CREATE TABLE `#__sales_order_status_state` (
  `status` varchar(32) NOT NULL COMMENT 'Status',
  `state` varchar(32) NOT NULL COMMENT 'Label',
  `is_default` smallint(5) unsigned NOT NULL COMMENT 'Is Default',
  PRIMARY KEY (`status`,`state`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Order Status Table';

INSERT INTO `#__sales_order_status_state` (`status`, `state`, `is_default`) VALUES
('canceled', 'canceled', 1),
('closed', 'closed', 1),
('complete', 'complete', 1),
('fraud', 'payment_review', 0),
('holded', 'holded', 1),
('payment_review', 'payment_review', 1),
('pending', 'new', 1),
('pending_payment', 'pending_payment', 1),
('processing', 'processing', 1);

CREATE TABLE `#__sales_order_tax` (
  `tax_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Tax Id',
  `order_id` int(10) unsigned NOT NULL COMMENT 'Order Id',
  `code` varchar(255) DEFAULT NULL COMMENT 'Code',
  `title` varchar(255) DEFAULT NULL COMMENT 'Title',
  `percent` decimal(12,4) DEFAULT NULL COMMENT 'Percent',
  `amount` decimal(12,4) DEFAULT NULL COMMENT 'Amount',
  `priority` int(11) NOT NULL COMMENT 'Priority',
  `position` int(11) NOT NULL COMMENT 'Position',
  `base_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Amount',
  `process` smallint(6) NOT NULL COMMENT 'Process',
  `base_real_amount` decimal(12,4) DEFAULT NULL COMMENT 'Base Real Amount',
  `hidden` smallint(5) unsigned NOT NULL COMMENT 'Hidden',
  PRIMARY KEY (`tax_id`),
  KEY `IDX_SALES_ORDER_TAX_ORDER_ID_PRIORITY_POSITION` (`order_id`,`priority`,`position`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Order Tax Table';


CREATE TABLE `#__sales_order_tax_item` (
  `tax_item_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Tax Item Id',
  `tax_id` int(10) unsigned NOT NULL COMMENT 'Tax Id',
  `item_id` int(10) unsigned NOT NULL COMMENT 'Item Id',
  `tax_percent` decimal(12,4) NOT NULL COMMENT 'Real Tax Percent For Item',
  PRIMARY KEY (`tax_item_id`),
  UNIQUE KEY `UNQ_SALES_ORDER_TAX_ITEM_TAX_ID_ITEM_ID` (`tax_id`,`item_id`),
  KEY `IDX_SALES_ORDER_TAX_ITEM_TAX_ID` (`tax_id`),
  KEY `IDX_SALES_ORDER_TAX_ITEM_ITEM_ID` (`item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Order Tax Item';


CREATE TABLE `#__sales_payment_transaction` (
  `transaction_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Transaction Id',
  `parent_id` int(10) unsigned DEFAULT NULL COMMENT 'Parent Id',
  `order_id` int(10) unsigned NOT NULL COMMENT 'Order Id',
  `payment_id` int(10) unsigned NOT NULL COMMENT 'Payment Id',
  `txn_id` varchar(100) DEFAULT NULL COMMENT 'Txn Id',
  `parent_txn_id` varchar(100) DEFAULT NULL COMMENT 'Parent Txn Id',
  `txn_type` varchar(15) DEFAULT NULL COMMENT 'Txn Type',
  `is_closed` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'Is Closed',
  `additional_information` blob COMMENT 'Additional Information',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  PRIMARY KEY (`transaction_id`),
  UNIQUE KEY `UNQ_SALES_PAYMENT_TRANSACTION_ORDER_ID_PAYMENT_ID_TXN_ID` (`order_id`,`payment_id`,`txn_id`),
  KEY `IDX_SALES_PAYMENT_TRANSACTION_ORDER_ID` (`order_id`),
  KEY `IDX_SALES_PAYMENT_TRANSACTION_PARENT_ID` (`parent_id`),
  KEY `IDX_SALES_PAYMENT_TRANSACTION_PAYMENT_ID` (`payment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Sales Payment Transaction';

INSERT INTO `#__sales_payment_transaction` (`transaction_id`, `parent_id`, `order_id`, `payment_id`, `txn_id`, `parent_txn_id`, `txn_type`, `is_closed`, `additional_information`, `created_at`) VALUES
(1, NULL, 1, 1, '11M472365T301554E', NULL, 'authorization', 0, NULL, '2011-04-06 03:37:23');

CREATE TABLE `#__sales_recurring_profile` (
  `profile_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Profile Id',
  `state` varchar(20) NOT NULL COMMENT 'State',
  `customer_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer Id',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `method_code` varchar(32) NOT NULL COMMENT 'Method Code',
  `created_at` timestamp NOT NULL COMMENT 'Created At',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  `reference_id` varchar(32) DEFAULT NULL COMMENT 'Reference Id',
  `subscriber_name` varchar(150) DEFAULT NULL COMMENT 'Subscriber Name',
  `start_datetime` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Start Datetime',
  `internal_reference_id` varchar(42) NOT NULL COMMENT 'Internal Reference Id',
  `schedule_description` varchar(255) NOT NULL COMMENT 'Schedule Description',
  `suspension_threshold` smallint(5) unsigned DEFAULT NULL COMMENT 'Suspension Threshold',
  `bill_failed_later` smallint(5) unsigned NOT NULL COMMENT 'Bill Failed Later',
  `period_unit` varchar(20) NOT NULL COMMENT 'Period Unit',
  `period_frequency` smallint(5) unsigned DEFAULT NULL COMMENT 'Period Frequency',
  `period_max_cycles` smallint(5) unsigned DEFAULT NULL COMMENT 'Period Max Cycles',
  `billing_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Billing Amount',
  `trial_period_unit` varchar(20) DEFAULT NULL COMMENT 'Trial Period Unit',
  `trial_period_frequency` smallint(5) unsigned DEFAULT NULL COMMENT 'Trial Period Frequency',
  `trial_period_max_cycles` smallint(5) unsigned DEFAULT NULL COMMENT 'Trial Period Max Cycles',
  `trial_billing_amount` text COMMENT 'Trial Billing Amount',
  `currency_code` varchar(3) NOT NULL COMMENT 'Currency Code',
  `shipping_amount` decimal(12,4) DEFAULT NULL COMMENT 'Shipping Amount',
  `tax_amount` decimal(12,4) DEFAULT NULL COMMENT 'Tax Amount',
  `init_amount` decimal(12,4) DEFAULT NULL COMMENT 'Init Amount',
  `init_may_fail` smallint(5) unsigned NOT NULL COMMENT 'Init May Fail',
  `order_info` text NOT NULL COMMENT 'Order Info',
  `order_item_info` text NOT NULL COMMENT 'Order Item Info',
  `billing_address_info` text NOT NULL COMMENT 'Billing Address Info',
  `shipping_address_info` text COMMENT 'Shipping Address Info',
  `profile_vendor_info` text COMMENT 'Profile Vendor Info',
  `additional_info` text COMMENT 'Additional Info',
  PRIMARY KEY (`profile_id`),
  UNIQUE KEY `UNQ_SALES_RECURRING_PROFILE_INTERNAL_REFERENCE_ID` (`internal_reference_id`),
  KEY `IDX_SALES_RECURRING_PROFILE_CUSTOMER_ID` (`customer_id`),
  KEY `IDX_SALES_RECURRING_PROFILE_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Recurring Profile';


CREATE TABLE `#__sales_recurring_profile_order` (
  `link_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Link Id',
  `profile_id` int(10) unsigned NOT NULL COMMENT 'Profile Id',
  `order_id` int(10) unsigned NOT NULL COMMENT 'Order Id',
  PRIMARY KEY (`link_id`),
  UNIQUE KEY `UNQ_SALES_RECURRING_PROFILE_ORDER_PROFILE_ID_ORDER_ID` (`profile_id`,`order_id`),
  KEY `IDX_SALES_RECURRING_PROFILE_ORDER_ORDER_ID` (`order_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Recurring Profile Order';


CREATE TABLE `#__sales_refunded_aggregated` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `order_status` varchar(50) NOT NULL COMMENT 'Order Status',
  `orders_count` int(11) NOT NULL COMMENT 'Orders Count',
  `refunded` decimal(12,4) DEFAULT NULL COMMENT 'Refunded',
  `online_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Online Refunded',
  `offline_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Offline Refunded',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_SALES_REFUNDED_AGGREGATED_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  KEY `IDX_SALES_REFUNDED_AGGREGATED_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Refunded Aggregated';


CREATE TABLE `#__sales_refunded_aggregated_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `order_status` varchar(50) DEFAULT NULL COMMENT 'Order Status',
  `orders_count` int(11) NOT NULL COMMENT 'Orders Count',
  `refunded` decimal(12,4) DEFAULT NULL COMMENT 'Refunded',
  `online_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Online Refunded',
  `offline_refunded` decimal(12,4) DEFAULT NULL COMMENT 'Offline Refunded',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_SALES_REFUNDED_AGGREGATED_ORDER_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  KEY `IDX_SALES_REFUNDED_AGGREGATED_ORDER_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Refunded Aggregated Order';


CREATE TABLE `#__sales_shipping_aggregated` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `order_status` varchar(50) DEFAULT NULL COMMENT 'Order Status',
  `shipping_description` varchar(255) DEFAULT NULL COMMENT 'Shipping Description',
  `orders_count` int(11) NOT NULL COMMENT 'Orders Count',
  `total_shipping` decimal(12,4) DEFAULT NULL COMMENT 'Total Shipping',
  `total_shipping_actual` decimal(12,4) DEFAULT NULL COMMENT 'Total Shipping Actual',
  PRIMARY KEY (`id`),
  UNIQUE KEY `UNQ_SALES_SHPP_AGGRED_PERIOD_STORE_ID_ORDER_STS_SHPP_DESCRIPTION` (`period`,`store_id`,`order_status`,`shipping_description`),
  KEY `IDX_SALES_SHIPPING_AGGREGATED_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Shipping Aggregated';


CREATE TABLE `#__sales_shipping_aggregated_order` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `order_status` varchar(50) DEFAULT NULL COMMENT 'Order Status',
  `shipping_description` varchar(255) DEFAULT NULL COMMENT 'Shipping Description',
  `orders_count` int(11) NOT NULL COMMENT 'Orders Count',
  `total_shipping` decimal(12,4) DEFAULT NULL COMMENT 'Total Shipping',
  `total_shipping_actual` decimal(12,4) DEFAULT NULL COMMENT 'Total Shipping Actual',
  PRIMARY KEY (`id`),
  UNIQUE KEY `C05FAE47282EEA68654D0924E946761F` (`period`,`store_id`,`order_status`,`shipping_description`),
  KEY `IDX_SALES_SHIPPING_AGGREGATED_ORDER_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Shipping Aggregated Order';


CREATE TABLE `#__salesrule` (
  `rule_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rule Id',
  `name` varchar(255) DEFAULT NULL COMMENT 'Name',
  `description` text COMMENT 'Description',
  `from_date` date DEFAULT NULL,
  `to_date` date DEFAULT NULL,
  `uses_per_customer` int(11) NOT NULL DEFAULT '0' COMMENT 'Uses Per Customer',
  `is_active` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Is Active',
  `conditions_serialized` mediumtext COMMENT 'Conditions Serialized',
  `actions_serialized` mediumtext COMMENT 'Actions Serialized',
  `stop_rules_processing` smallint(6) NOT NULL DEFAULT '1' COMMENT 'Stop Rules Processing',
  `is_advanced` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'Is Advanced',
  `product_ids` text COMMENT 'Product Ids',
  `sort_order` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Sort Order',
  `simple_action` varchar(32) DEFAULT NULL COMMENT 'Simple Action',
  `discount_amount` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Discount Amount',
  `discount_qty` decimal(12,4) DEFAULT NULL COMMENT 'Discount Qty',
  `discount_step` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Discount Step',
  `simple_free_shipping` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Simple Free Shipping',
  `apply_to_shipping` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Apply To Shipping',
  `times_used` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Times Used',
  `is_rss` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Is Rss',
  `coupon_type` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'Coupon Type',
  `use_auto_generation` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Use Auto Generation',
  `uses_per_coupon` int(11) NOT NULL DEFAULT '0' COMMENT 'Uses Per Coupon',
  PRIMARY KEY (`rule_id`),
  KEY `IDX_SALESRULE_IS_ACTIVE_SORT_ORDER_TO_DATE_FROM_DATE` (`is_active`,`sort_order`,`to_date`,`from_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Salesrule';

INSERT INTO `#__salesrule` (`rule_id`, `name`, `description`, `from_date`, `to_date`, `uses_per_customer`, `is_active`, `conditions_serialized`, `actions_serialized`, `stop_rules_processing`, `is_advanced`, `product_ids`, `sort_order`, `simple_action`, `discount_amount`, `discount_qty`, `discount_step`, `simple_free_shipping`, `apply_to_shipping`, `times_used`, `is_rss`, `coupon_type`, `use_auto_generation`, `uses_per_coupon`) VALUES
(1, 'Coupon', NULL, '2011-11-08', NULL, 0, 1, 'a:6:{s:4:"type";s:32:"salesrule/rule_condition_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}', 'a:6:{s:4:"type";s:40:"salesrule/rule_condition_product_combine";s:9:"attribute";N;s:8:"operator";N;s:5:"value";s:1:"1";s:18:"is_value_processed";N;s:10:"aggregator";s:3:"all";}', 0, 1, NULL, 0, 'by_percent', '0.0000', NULL, 0, 0, 0, 2, 1, 2, 0, 0);

CREATE TABLE `#__salesrule_coupon` (
  `coupon_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Coupon Id',
  `rule_id` int(10) unsigned NOT NULL COMMENT 'Rule Id',
  `code` varchar(255) DEFAULT NULL COMMENT 'Code',
  `usage_limit` int(10) unsigned DEFAULT NULL COMMENT 'Usage Limit',
  `usage_per_customer` int(10) unsigned DEFAULT NULL COMMENT 'Usage Per Customer',
  `times_used` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Times Used',
  `expiration_date` timestamp NULL DEFAULT NULL COMMENT 'Expiration Date',
  `is_primary` smallint(5) unsigned DEFAULT NULL COMMENT 'Is Primary',
  `created_at` timestamp NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT 'Coupon Code Creation Date',
  `type` smallint(6) DEFAULT '0' COMMENT 'Coupon Code Type',
  PRIMARY KEY (`coupon_id`),
  UNIQUE KEY `UNQ_SALESRULE_COUPON_CODE` (`code`),
  UNIQUE KEY `UNQ_SALESRULE_COUPON_RULE_ID_IS_PRIMARY` (`rule_id`,`is_primary`),
  KEY `IDX_SALESRULE_COUPON_RULE_ID` (`rule_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Salesrule Coupon';

INSERT INTO `#__salesrule_coupon` (`coupon_id`, `rule_id`, `code`, `usage_limit`, `usage_per_customer`, `times_used`, `expiration_date`, `is_primary`, `created_at`, `type`) VALUES
(1, 1, '12345', NULL, NULL, 2, NULL, 1, '0000-00-00 00:00:00', 0);

CREATE TABLE `#__salesrule_coupon_usage` (
  `coupon_id` int(10) unsigned NOT NULL COMMENT 'Coupon Id',
  `customer_id` int(10) unsigned NOT NULL COMMENT 'Customer Id',
  `times_used` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Times Used',
  PRIMARY KEY (`coupon_id`,`customer_id`),
  KEY `IDX_SALESRULE_COUPON_USAGE_COUPON_ID` (`coupon_id`),
  KEY `IDX_SALESRULE_COUPON_USAGE_CUSTOMER_ID` (`customer_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Salesrule Coupon Usage';

INSERT INTO `#__salesrule_coupon_usage` (`coupon_id`, `customer_id`, `times_used`) VALUES
(1, 3, 2);

CREATE TABLE `#__salesrule_customer` (
  `rule_customer_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Rule Customer Id',
  `rule_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Rule Id',
  `customer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Id',
  `times_used` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Times Used',
  PRIMARY KEY (`rule_customer_id`),
  KEY `IDX_SALESRULE_CUSTOMER_RULE_ID_CUSTOMER_ID` (`rule_id`,`customer_id`),
  KEY `IDX_SALESRULE_CUSTOMER_CUSTOMER_ID_RULE_ID` (`customer_id`,`rule_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Salesrule Customer';

INSERT INTO `#__salesrule_customer` (`rule_customer_id`, `rule_id`, `customer_id`, `times_used`) VALUES
(1, 1, 3, 2);

CREATE TABLE `#__salesrule_customer_group` (
  `rule_id` int(10) unsigned NOT NULL COMMENT 'Rule Id',
  `customer_group_id` smallint(5) unsigned NOT NULL COMMENT 'Customer Group Id',
  PRIMARY KEY (`rule_id`,`customer_group_id`),
  KEY `IDX_SALESRULE_CUSTOMER_GROUP_RULE_ID` (`rule_id`),
  KEY `IDX_SALESRULE_CUSTOMER_GROUP_CUSTOMER_GROUP_ID` (`customer_group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Rules To Customer Groups Relations';

INSERT INTO `#__salesrule_customer_group` (`rule_id`, `customer_group_id`) VALUES
(1, 0),
(1, 1),
(1, 2),
(1, 3),
(1, 4);

CREATE TABLE `#__salesrule_label` (
  `label_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Label Id',
  `rule_id` int(10) unsigned NOT NULL COMMENT 'Rule Id',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store Id',
  `label` varchar(255) DEFAULT NULL COMMENT 'Label',
  PRIMARY KEY (`label_id`),
  UNIQUE KEY `UNQ_SALESRULE_LABEL_RULE_ID_STORE_ID` (`rule_id`,`store_id`),
  KEY `IDX_SALESRULE_LABEL_STORE_ID` (`store_id`),
  KEY `IDX_SALESRULE_LABEL_RULE_ID` (`rule_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Salesrule Label';


CREATE TABLE `#__salesrule_product_attribute` (
  `rule_id` int(10) unsigned NOT NULL COMMENT 'Rule Id',
  `website_id` smallint(5) unsigned NOT NULL COMMENT 'Website Id',
  `customer_group_id` smallint(5) unsigned NOT NULL COMMENT 'Customer Group Id',
  `attribute_id` smallint(5) unsigned NOT NULL COMMENT 'Attribute Id',
  PRIMARY KEY (`rule_id`,`website_id`,`customer_group_id`,`attribute_id`),
  KEY `IDX_SALESRULE_PRODUCT_ATTRIBUTE_WEBSITE_ID` (`website_id`),
  KEY `IDX_SALESRULE_PRODUCT_ATTRIBUTE_CUSTOMER_GROUP_ID` (`customer_group_id`),
  KEY `IDX_SALESRULE_PRODUCT_ATTRIBUTE_ATTRIBUTE_ID` (`attribute_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Salesrule Product Attribute';


CREATE TABLE `#__salesrule_website` (
  `rule_id` int(10) unsigned NOT NULL COMMENT 'Rule Id',
  `website_id` smallint(5) unsigned NOT NULL COMMENT 'Website Id',
  PRIMARY KEY (`rule_id`,`website_id`),
  KEY `IDX_SALESRULE_WEBSITE_RULE_ID` (`rule_id`),
  KEY `IDX_SALESRULE_WEBSITE_WEBSITE_ID` (`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Sales Rules To Websites Relations';

INSERT INTO `#__salesrule_website` (`rule_id`, `website_id`) VALUES
(1, 1);

CREATE TABLE `#__sendfriend_log` (
  `log_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Log ID',
  `ip` varbinary(16) DEFAULT NULL,
  `time` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Log time',
  `website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID',
  PRIMARY KEY (`log_id`),
  KEY `IDX_SENDFRIEND_LOG_IP` (`ip`),
  KEY `IDX_SENDFRIEND_LOG_TIME` (`time`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Send to friend function log storage table';


CREATE TABLE `#__shipping_tablerate` (
  `pk` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Primary key',
  `website_id` int(11) NOT NULL DEFAULT '0' COMMENT 'Website Id',
  `dest_country_id` varchar(4) NOT NULL DEFAULT '0' COMMENT 'Destination coutry ISO/2 or ISO/3 code',
  `dest_region_id` int(11) NOT NULL DEFAULT '0' COMMENT 'Destination Region Id',
  `dest_zip` varchar(10) NOT NULL DEFAULT '*' COMMENT 'Destination Post Code (Zip)',
  `condition_name` varchar(20) NOT NULL COMMENT 'Rate Condition name',
  `condition_value` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Rate condition value',
  `price` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Price',
  `cost` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Cost',
  PRIMARY KEY (`pk`),
  UNIQUE KEY `D60821CDB2AFACEE1566CFC02D0D4CAA` (`website_id`,`dest_country_id`,`dest_region_id`,`dest_zip`,`condition_name`,`condition_value`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Shipping Tablerate';


CREATE TABLE `#__sitemap` (
  `sitemap_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Sitemap Id',
  `sitemap_type` varchar(32) DEFAULT NULL COMMENT 'Sitemap Type',
  `sitemap_filename` varchar(32) DEFAULT NULL COMMENT 'Sitemap Filename',
  `sitemap_path` varchar(255) DEFAULT NULL COMMENT 'Sitemap Path',
  `sitemap_time` timestamp NULL DEFAULT NULL COMMENT 'Sitemap Time',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store id',
  PRIMARY KEY (`sitemap_id`),
  KEY `IDX_SITEMAP_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Google Sitemap';


CREATE TABLE `#__strikeiron_tax_rate` (
  `tax_rate_id` tinyint(4) NOT NULL AUTO_INCREMENT,
  `tax_country_id` varchar(6) DEFAULT NULL,
  `tax_region_id` mediumint(9) unsigned DEFAULT NULL,
  `tax_postcode` varchar(12) DEFAULT NULL,
  `rate_value` decimal(12,4) NOT NULL DEFAULT '0.0000',
  PRIMARY KEY (`tax_rate_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Strikeiron tax rates';


CREATE TABLE `#__tag` (
  `tag_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Tag Id',
  `name` varchar(255) DEFAULT NULL COMMENT 'Name',
  `status` smallint(6) NOT NULL DEFAULT '0' COMMENT 'Status',
  `first_customer_id` int(10) unsigned DEFAULT NULL COMMENT 'First Customer Id',
  `first_store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'First Store Id',
  PRIMARY KEY (`tag_id`),
  KEY `FK_TAG_FIRST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` (`first_customer_id`),
  KEY `FK_TAG_FIRST_STORE_ID_CORE_STORE_STORE_ID` (`first_store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  ROW_FORMAT=DYNAMIC COMMENT='Tag';

INSERT INTO `#__tag` (`tag_id`, `name`, `status`, `first_customer_id`, `first_store_id`) VALUES
(1, 'bed', 1, 1, 1),
(2, 'trendy', 1, 1, 1),
(3, 'wood', 1, 1, 1),
(4, 'young', 1, 1, 1),
(5, 'hip', 1, 1, 1),
(6, 'Excellent', 1, 1, 1),
(7, 'Furniture', 1, 1, 1),
(8, 'modern', 1, 1, 1),
(9, 'pocket', 1, 1, 1),
(10, 'clean', 1, 1, 1),
(11, 'apple', 1, 1, 1),
(12, 'cool', 1, 1, 1),
(13, 'universal', 1, 1, 1),
(14, 'clogs', 1, 1, 1),
(15, 'outdoor', 1, 1, 1),
(16, 'green', 1, 1, 1),
(17, 'bones', 1, 1, 1),
(18, 'pda', 1, 1, 1),
(19, 'slider', 1, 1, 1),
(20, 'mobile', 1, 1, 1),
(21, 'joe', 1, 1, 1),
(22, 'laces', 1, 1, 1),
(23, 'Camera', 1, 1, 2),
(24, 'charger', 1, 1, 2),
(25, 'Geil', 1, 1, 2),
(26, 'crackberry', 1, 1, 1),
(27, 'SEXY', 1, 1, 1),
(28, 'tight', 1, 1, 1),
(29, 'Test', 1, 1, 1),
(30, 'red', 1, 1, 1),
(31, 'sandals', 1, 1, 1),
(32, 'design', 1, 1, 1),
(33, 'ugly', 1, 1, 1),
(34, 'rubber', 1, 1, 1),
(35, 'light', 1, 1, 1),
(36, 'monikas', 1, 1, 1),
(37, 't-shirt', 1, 1, 1),
(38, 'test,', 1, 1, 1),
(39, 'Sportsshoes', 1, 1, 1),
(40, 'very', 1, 1, 1),
(41, 'good', 1, 1, 1),
(42, 'phone', 1, 1, 1),
(43, 'favorite', 1, 1, 1),
(44, 'shoe', 1, 1, 1),
(45, 'shirt', 1, 1, 1),
(46, 'monkeybutt', 1, 1, 1),
(47, 'pizzamonkey', 1, 1, 1),
(48, 'silver', 1, 1, 1),
(49, 'black', 1, 1, 1),
(50, 'sony', 1, 1, 1),
(51, 'laptop', 1, 1, 1),
(52, 'compact', 1, 1, 1),
(53, 'small screen', 1, 1, 1),
(54, 'tee-shirt', 1, 1, 1),
(55, 'computer', 1, 1, 1),
(56, 'shoes', 1, 1, 1),
(57, 'sandale', 1, 1, 1),
(58, 'tina', 1, 1, 1),
(59, 'brown', 1, 1, 1),
(60, 'lova', 1, 1, 1),
(61, 'Tag', 1, 1, 1),
(62, 'toes', -1, 1, 1),
(63, 'mniam', 1, 1, 1),
(64, 'couch', 1, 1, 1),
(65, 'chair', 1, 1, 1),
(66, 'sandals,', 1, 1, 1),
(67, 'blue,', 1, 1, 1),
(68, 'shoes,', 1, 1, 1),
(69, 'small', 1, 1, 1),
(70, 'nice', 1, 1, 1),
(71, 'badassness', 1, 1, 1),
(72, 'cellotastic', 1, 1, 1),
(73, 'macbook', 1, 1, 1),
(74, 'mac', 1, 1, 1),
(75, 'thongs', 1, 1, 1),
(76, 'bla', 1, 1, 3),
(77, 'notebook', 1, 1, 2),
(78, 'phonex', 1, 1, 1),
(79, 'sÃƒÆ’Ã†â€™Ãƒâ€ Ã¢â‚¬â„¢ÃƒÆ’Ã¢â‚¬Â ÃƒÂ¢Ã¢â€šÂ¬Ã¢â€žÂ¢ÃÃ', 1, 1, 1),
(80, 'testing', 1, 1, 1),
(81, 'awesome', 1, 1, 1),
(82, 'holeys', 1, 1, 1),
(83, 'Innovate', 1, 1, 1),
(84, 'buenisimo', 1, 1, 1),
(85, 'laptopik', 1, 1, 1),
(86, 'rouge', 1, 1, 1),
(87, 'modern,', 1, 1, 1),
(88, 'moderne', 1, 1, 1),
(89, 'blue', 1, 1, 1),
(90, 'sandally', 1, 1, 1),
(91, 'zoom', 1, 1, 1),
(92, 'amazing', 1, 1, 1),
(93, 'acer', 1, 1, 1),
(94, 'portable', 1, 1, 1),
(95, 'nippley', 1, 1, 1),
(96, 'headless', 1, 1, 1),
(97, 'prettyboy', 1, 1, 1),
(98, 'grey', 1, 1, 1),
(99, 'pouffe', 1, 1, 1),
(100, 'teste', 1, 1, 1),
(101, 'photography', 1, 1, 1),
(102, 'handy', 1, 1, 2),
(103, 'strange', 1, 1, 2),
(104, 'skeleton', 1, 1, 2),
(105, 'terry''s', 1, 1, 1),
(106, 'green,', 1, 1, 1),
(107, 'sexy,', 1, 1, 1),
(108, 'hi', 1, 1, 1),
(109, 'Hohoho', 1, 1, 2),
(110, 'Image', 1, 1, 1),
(111, 'canape', 1, 1, 1),
(112, 'chic', 1, 1, 1),
(113, 'dresser', 1, 1, 1),
(114, 'lens', 1, 1, 1),
(115, 'schoen', 1, 1, 1),
(116, 'golf', 1, 1, 1),
(117, 'philip', 1, 1, 1),
(118, 'coconut', 1, 1, 1),
(119, 'mytag', 1, 1, 1),
(120, 'mesas', 1, 1, 1),
(121, 'hideous', 1, 1, 1),
(122, 'mystuff', 1, 1, 1),
(123, 'user', 1, 1, 1),
(124, 'shittt', 1, 1, 1),
(125, 'sex', 1, 1, 1),
(126, 'sucks', 1, 1, 1),
(127, 'whynot', 1, 1, 3),
(128, 'camera-photo', 1, 1, 3),
(129, 'wow', 1, 1, 1),
(130, 'kzyhu', 1, 1, 1),
(131, 'badminded', 1, 1, 2),
(132, 'noerd', 1, 1, 2),
(133, 'square', 1, 1, 1),
(134, 'beach', 1, 1, 1),
(135, 'Core Duo', 1, 1, 1),
(136, 'spray', 1, 1, 1),
(137, 'paint', 1, 1, 1),
(138, 'tempos', 1, 1, 1),
(139, 'teacher', 1, 1, 1),
(140, 'ATT', 1, 1, 1),
(141, 'BlackBerry', 1, 1, 1),
(142, 'gadget', 1, 1, 1),
(143, 'pas', 1, 1, 3),
(144, 'mal', 1, 1, 3),
(145, 'SMUKKE', 1, 1, 1),
(146, 'kurti', 1, 1, 1),
(147, 'larum', 1, 1, 1),
(148, 'try', 1, 0, 0),
(149, 'WAAAAAOOO', 1, 1, 1),
(150, 'portatil', 1, 1, 1),
(151, 'CRAPOTO', 1, 1, 3),
(152, 'Kamera,', 1, 1, 2),
(153, 'Camera,', 1, 1, 2),
(154, 'Olympus', 1, 1, 2),
(155, 'Nine', 1, 1, 1),
(156, 'West', 1, 1, 1),
(157, 'Women''s', 1, 1, 1),
(158, 'Lucero', 1, 1, 1),
(159, 'Pump', 1, 1, 1),
(160, 'Web', 1, 1, 1),
(161, 'browser', 1, 1, 1),
(162, 'content,', 1, 1, 1),
(163, 'messaging', 1, 1, 1),
(164, 'sessions,', 1, 1, 1),
(165, 'and', -1, 1, 1),
(166, 'attachments.', 1, 1, 1),
(167, 'Anashria', 1, 1, 1),
(168, 'Womens', 1, 1, 1),
(169, 'Premier', 1, 1, 1),
(170, 'Leather', 1, 1, 1),
(171, 'Sandal', 1, 1, 1),
(172, 'arbeit', -1, 1, 2),
(173, 'crap', 1, 1, 1),
(174, 'Walkman', 1, 1, 1),
(175, 'gift', 1, 1, 1),
(176, 'for', -1, 1, 1),
(177, 'her', 1, 1, 1),
(178, 'Hupe', 1, 1, 1),
(179, 'sleek', -1, 1, 1),
(180, 'samsung', 1, 1, 1),
(181, 'footrest', 1, 1, 1),
(182, 'shit', 1, 1, 1),
(183, 'jogging', 1, 1, 1),
(184, 'cool t-shirt', 1, 1, 1),
(185, 'must get', 1, 1, 1),
(186, 'bright', 1, 1, 2),
(187, 'cellphone', 1, 1, 1),
(188, 'comfort', 1, 1, 3),
(189, 'ferrari', 1, 1, 1),
(190, 'shiny', 1, 1, 1),
(191, 'toll', 1, 1, 1),
(192, 'warm', 1, 1, 1),
(193, 'SOFA', 1, 1, 1),
(194, 'fast', 1, 1, 1),
(195, 'emo', 1, 1, 1),
(196, 'smart', 1, 1, 1),
(197, 'Canon', 1, 1, 3),
(198, 'appletoys', 1, 1, 1),
(199, 'joom', 0, 3, 1),
(200, 'monitor', 0, 3, 1),
(201, 'men', 1, NULL, NULL),
(202, 'women', 1, NULL, NULL),
(203, 'Commuting', 1, NULL, NULL),
(204, 'Jerseys', 1, NULL, NULL),
(205, 'Racks', 1, NULL, NULL),
(206, 'Fenders', 1, NULL, NULL),
(207, 'Headwear', 1, NULL, NULL),
(208, 'Shorts & Bibs', 1, NULL, NULL),
(209, 'Baskets', 1, NULL, NULL),
(210, 'Saddles', 1, NULL, NULL),
(211, 'Wheels', 1, NULL, NULL),
(212, 'Tights & Knickers', 1, NULL, NULL);

CREATE TABLE `#__tag_properties` (
  `tag_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Tag Id',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Id',
  `base_popularity` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Base Popularity',
  PRIMARY KEY (`tag_id`,`store_id`),
  KEY `FK_j502fa_TAG_PROPERTIES_STORE` (`store_id`),
  KEY `IDX_TAG_PROPERTIES_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Tag Properties';

INSERT INTO `#__tag_properties` (`tag_id`, `store_id`, `base_popularity`) VALUES
(201, 1, 5),
(202, 1, 7),
(203, 1, 2),
(204, 1, 7),
(205, 1, 6),
(206, 1, 7),
(207, 1, 12),
(208, 1, 8),
(209, 1, 3),
(210, 1, 4),
(211, 1, 9),
(212, 1, 1);

CREATE TABLE `#__tag_relation` (
  `tag_relation_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Tag Relation Id',
  `tag_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Tag Id',
  `customer_id` int(10) unsigned DEFAULT NULL COMMENT 'Customer Id',
  `product_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Product Id',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'Store Id',
  `active` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'Active',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  PRIMARY KEY (`tag_relation_id`),
  UNIQUE KEY `UNQ_TAG_RELATION_TAG_ID_CUSTOMER_ID_PRODUCT_ID_STORE_ID` (`tag_id`,`customer_id`,`product_id`,`store_id`),
  KEY `IDX_TAG_RELATION_PRODUCT_ID` (`product_id`),
  KEY `IDX_TAG_RELATION_TAG_ID` (`tag_id`),
  KEY `IDX_TAG_RELATION_CUSTOMER_ID` (`customer_id`),
  KEY `IDX_TAG_RELATION_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Tag Relation';


CREATE TABLE `#__tag_summary` (
  `tag_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Tag Id',
  `store_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Id',
  `customers` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Customers',
  `products` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Products',
  `uses` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Uses',
  `historical_uses` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Historical Uses',
  `popularity` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Popularity',
  `base_popularity` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Base Popularity',
  PRIMARY KEY (`tag_id`,`store_id`),
  KEY `IDX_TAG_SUMMARY_STORE_ID` (`store_id`),
  KEY `IDX_TAG_SUMMARY_TAG_ID` (`tag_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Tag Summary';


CREATE TABLE `#__tax_calculation` (
  `tax_calculation_rate_id` int(11) NOT NULL COMMENT 'Tax Calculation Rate Id',
  `tax_calculation_rule_id` int(11) NOT NULL COMMENT 'Tax Calculation Rule Id',
  `customer_tax_class_id` smallint(6) NOT NULL COMMENT 'Customer Tax Class Id',
  `product_tax_class_id` smallint(6) NOT NULL COMMENT 'Product Tax Class Id',
  `tax_calculation_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Tax Calculation Id',
  PRIMARY KEY (`tax_calculation_id`),
  KEY `IDX_TAX_CALCULATION_TAX_CALCULATION_RULE_ID` (`tax_calculation_rule_id`),
  KEY `IDX_TAX_CALCULATION_TAX_CALCULATION_RATE_ID` (`tax_calculation_rate_id`),
  KEY `IDX_TAX_CALCULATION_CUSTOMER_TAX_CLASS_ID` (`customer_tax_class_id`),
  KEY `IDX_TAX_CALCULATION_PRODUCT_TAX_CLASS_ID` (`product_tax_class_id`),
  KEY `IDX_TAX_CALC_TAX_CALC_RATE_ID_CSTR_TAX_CLASS_ID_PRD_TAX_CLASS_ID` (`tax_calculation_rate_id`,`customer_tax_class_id`,`product_tax_class_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Tax Calculation';

INSERT INTO `#__tax_calculation` (`tax_calculation_rate_id`, `tax_calculation_rule_id`, `customer_tax_class_id`, `product_tax_class_id`, `tax_calculation_id`) VALUES
(1, 2, 3, 1, 1),
(2, 2, 3, 1, 2),
(1, 1, 3, 2, 3),
(2, 1, 3, 2, 4);

CREATE TABLE `#__tax_calculation_rate` (
  `tax_calculation_rate_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Tax Calculation Rate Id',
  `tax_country_id` varchar(2) NOT NULL COMMENT 'Tax Country Id',
  `tax_region_id` int(11) NOT NULL COMMENT 'Tax Region Id',
  `tax_postcode` varchar(21) DEFAULT NULL COMMENT 'Tax Postcode',
  `code` varchar(255) NOT NULL COMMENT 'Code',
  `rate` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Rate',
  `zip_is_range` smallint(6) DEFAULT NULL COMMENT 'Zip Is Range',
  `zip_from` int(10) unsigned DEFAULT NULL COMMENT 'Zip From',
  `zip_to` int(10) unsigned DEFAULT NULL COMMENT 'Zip To',
  PRIMARY KEY (`tax_calculation_rate_id`),
  KEY `IDX_TAX_CALC_RATE_TAX_COUNTRY_ID_TAX_REGION_ID_TAX_POSTCODE` (`tax_country_id`,`tax_region_id`,`tax_postcode`),
  KEY `IDX_TAX_CALCULATION_RATE_CODE` (`code`),
  KEY `CA799F1E2CB843495F601E56C84A626D` (`tax_calculation_rate_id`,`tax_country_id`,`tax_region_id`,`zip_is_range`,`tax_postcode`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Tax Calculation Rate';

INSERT INTO `#__tax_calculation_rate` (`tax_calculation_rate_id`, `tax_country_id`, `tax_region_id`, `tax_postcode`, `code`, `rate`, `zip_is_range`, `zip_from`, `zip_to`) VALUES
(1, 'US', 12, '*', 'US-CA-*-Rate 1', '8.2500', NULL, NULL, NULL),
(2, 'US', 43, '*', 'US-NY-*-Rate 1', '8.3750', NULL, NULL, NULL);

CREATE TABLE `#__tax_calculation_rate_title` (
  `tax_calculation_rate_title_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Tax Calculation Rate Title Id',
  `tax_calculation_rate_id` int(11) NOT NULL COMMENT 'Tax Calculation Rate Id',
  `store_id` smallint(5) unsigned NOT NULL COMMENT 'Store Id',
  `value` varchar(255) NOT NULL COMMENT 'Value',
  PRIMARY KEY (`tax_calculation_rate_title_id`),
  KEY `IDX_TAX_CALCULATION_RATE_TITLE_TAX_CALCULATION_RATE_ID_STORE_ID` (`tax_calculation_rate_id`,`store_id`),
  KEY `IDX_TAX_CALCULATION_RATE_TITLE_TAX_CALCULATION_RATE_ID` (`tax_calculation_rate_id`),
  KEY `IDX_TAX_CALCULATION_RATE_TITLE_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Tax Calculation Rate Title';


CREATE TABLE `#__tax_calculation_rule` (
  `tax_calculation_rule_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Tax Calculation Rule Id',
  `code` varchar(255) NOT NULL COMMENT 'Code',
  `priority` int(11) NOT NULL COMMENT 'Priority',
  `position` int(11) NOT NULL COMMENT 'Position',
  `calculate_subtotal` int(11) NOT NULL COMMENT 'Calculate off subtotal option',
  PRIMARY KEY (`tax_calculation_rule_id`),
  KEY `IDX_TAX_CALC_RULE_PRIORITY_POSITION_TAX_CALC_RULE_ID` (`priority`,`position`,`tax_calculation_rule_id`),
  KEY `IDX_TAX_CALCULATION_RULE_CODE` (`code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Tax Calculation Rule';

INSERT INTO `#__tax_calculation_rule` (`tax_calculation_rule_id`, `code`, `priority`, `position`, `calculate_subtotal`) VALUES
(1, 'Retail Customer-Taxable Goods-Rate 1', 1, 1, 0),
(2, 'Retail Customer-default-Rate 1', 1, 1, 0);

CREATE TABLE `#__tax_class` (
  `class_id` smallint(6) NOT NULL AUTO_INCREMENT COMMENT 'Class Id',
  `class_name` varchar(255) NOT NULL COMMENT 'Class Name',
  `class_type` varchar(8) NOT NULL DEFAULT 'CUSTOMER' COMMENT 'Class Type',
  PRIMARY KEY (`class_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Tax Class';

INSERT INTO `#__tax_class` (`class_id`, `class_name`, `class_type`) VALUES
(1, 'default', 'PRODUCT'),
(2, 'Taxable Goods', 'PRODUCT'),
(3, 'Retail Customer', 'CUSTOMER'),
(4, 'Shipping', 'PRODUCT');

CREATE TABLE `#__tax_order_aggregated_created` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `code` varchar(255) NOT NULL COMMENT 'Code',
  `order_status` varchar(50) NOT NULL COMMENT 'Order Status',
  `percent` float DEFAULT NULL COMMENT 'Percent',
  `orders_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Orders Count',
  `tax_base_amount_sum` float DEFAULT NULL COMMENT 'Tax Base Amount Sum',
  PRIMARY KEY (`id`),
  UNIQUE KEY `FCA5E2C02689EB2641B30580D7AACF12` (`period`,`store_id`,`code`,`percent`,`order_status`),
  KEY `IDX_TAX_ORDER_AGGREGATED_CREATED_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Tax Order Aggregation';


CREATE TABLE `#__tax_order_aggregated_updated` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Id',
  `period` date DEFAULT NULL COMMENT 'Period',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `code` varchar(255) NOT NULL COMMENT 'Code',
  `order_status` varchar(50) NOT NULL COMMENT 'Order Status',
  `percent` float DEFAULT NULL COMMENT 'Percent',
  `orders_count` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Orders Count',
  `tax_base_amount_sum` float DEFAULT NULL COMMENT 'Tax Base Amount Sum',
  PRIMARY KEY (`id`),
  UNIQUE KEY `DB0AF14011199AA6CD31D5078B90AA8D` (`period`,`store_id`,`code`,`percent`,`order_status`),
  KEY `IDX_TAX_ORDER_AGGREGATED_UPDATED_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Tax Order Aggregated Updated';


CREATE TABLE `#__weee_discount` (
  `entity_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Entity Id',
  `website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website Id',
  `customer_group_id` smallint(5) unsigned NOT NULL COMMENT 'Customer Group Id',
  `value` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Value',
  KEY `IDX_WEEE_DISCOUNT_WEBSITE_ID` (`website_id`),
  KEY `IDX_WEEE_DISCOUNT_ENTITY_ID` (`entity_id`),
  KEY `IDX_WEEE_DISCOUNT_CUSTOMER_GROUP_ID` (`customer_group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Weee Discount';


CREATE TABLE `#__weee_tax` (
  `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id',
  `website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website Id',
  `entity_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Entity Id',
  `country` varchar(2) DEFAULT NULL COMMENT 'Country',
  `value` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Value',
  `state` varchar(255) NOT NULL DEFAULT '*' COMMENT 'State',
  `attribute_id` smallint(5) unsigned NOT NULL COMMENT 'Attribute Id',
  `entity_type_id` smallint(5) unsigned NOT NULL COMMENT 'Entity Type Id',
  PRIMARY KEY (`value_id`),
  KEY `IDX_WEEE_TAX_WEBSITE_ID` (`website_id`),
  KEY `IDX_WEEE_TAX_ENTITY_ID` (`entity_id`),
  KEY `IDX_WEEE_TAX_COUNTRY` (`country`),
  KEY `IDX_WEEE_TAX_ATTRIBUTE_ID` (`attribute_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Weee Tax';


CREATE TABLE `#__widget` (
  `widget_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Widget Id',
  `widget_code` varchar(255) DEFAULT NULL COMMENT 'Widget code for template directive',
  `widget_type` varchar(255) DEFAULT NULL COMMENT 'Widget Type',
  `parameters` text COMMENT 'Parameters',
  PRIMARY KEY (`widget_id`),
  KEY `IDX_WIDGET_WIDGET_CODE` (`widget_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Preconfigured Widgets';


CREATE TABLE `#__widget_instance` (
  `instance_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Instance Id',
  `instance_type` varchar(255) DEFAULT NULL COMMENT 'Instance Type',
  `package_theme` varchar(255) DEFAULT NULL COMMENT 'Package Theme',
  `title` varchar(255) DEFAULT NULL COMMENT 'Widget Title',
  `store_ids` varchar(255) NOT NULL DEFAULT '0' COMMENT 'Store ids',
  `widget_parameters` text COMMENT 'Widget parameters',
  `sort_order` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Sort order',
  PRIMARY KEY (`instance_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Instances of Widget for Package Theme';


CREATE TABLE `#__widget_instance_page` (
  `page_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Page Id',
  `instance_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Instance Id',
  `page_group` varchar(25) DEFAULT NULL COMMENT 'Block Group Type',
  `layout_handle` varchar(255) DEFAULT NULL COMMENT 'Layout Handle',
  `block_reference` varchar(255) DEFAULT NULL COMMENT 'Block Reference',
  `page_for` varchar(25) DEFAULT NULL COMMENT 'For instance entities',
  `entities` text COMMENT 'Catalog entities (comma separated)',
  `page_template` varchar(255) DEFAULT NULL COMMENT 'Path to widget template',
  PRIMARY KEY (`page_id`),
  KEY `IDX_WIDGET_INSTANCE_PAGE_INSTANCE_ID` (`instance_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Instance of Widget on Page';


CREATE TABLE `#__widget_instance_page_layout` (
  `page_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Page Id',
  `layout_update_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Layout Update Id',
  UNIQUE KEY `UNQ_WIDGET_INSTANCE_PAGE_LAYOUT_LAYOUT_UPDATE_ID_PAGE_ID` (`layout_update_id`,`page_id`),
  KEY `IDX_WIDGET_INSTANCE_PAGE_LAYOUT_PAGE_ID` (`page_id`),
  KEY `IDX_WIDGET_INSTANCE_PAGE_LAYOUT_LAYOUT_UPDATE_ID` (`layout_update_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Layout updates';


CREATE TABLE `#__wishlist` (
  `wishlist_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Wishlist ID',
  `customer_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer ID',
  `shared` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Sharing flag (0 or 1)',
  `sharing_code` varchar(32) DEFAULT NULL COMMENT 'Sharing encrypted code',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Last updated date',
  PRIMARY KEY (`wishlist_id`),
  UNIQUE KEY `FK_CUSTOMER` (`customer_id`),
  UNIQUE KEY `UNQ_WISHLIST_CUSTOMER_ID` (`customer_id`),
  KEY `IDX_WISHLIST_SHARED` (`shared`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  ROW_FORMAT=DYNAMIC COMMENT='Wishlist main Table';

INSERT INTO `#__wishlist` (`wishlist_id`, `customer_id`, `shared`, `sharing_code`, `updated_at`) VALUES
(1, 2, 0, '77be83ce5ad7e2efda9c350c15198374', '2011-04-06 04:31:38'),
(2, 3, 0, '18b106c69fc5aec645f9c4fc9b70b64e', '2012-08-24 04:26:41');

CREATE TABLE `#__wishlist_item` (
  `wishlist_item_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Wishlist item ID',
  `wishlist_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Wishlist ID',
  `product_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Product ID',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store ID',
  `added_at` timestamp NULL DEFAULT NULL COMMENT 'Add date and time',
  `description` text COMMENT 'Short description of wish list item',
  `qty` decimal(12,4) NOT NULL COMMENT 'Qty',
  PRIMARY KEY (`wishlist_item_id`),
  KEY `FK_ITEM_WISHLIST` (`wishlist_id`),
  KEY `FK_WISHLIST_PRODUCT` (`product_id`),
  KEY `FK_WISHLIST_STORE` (`store_id`),
  KEY `IDX_WISHLIST_ITEM_WISHLIST_ID` (`wishlist_id`),
  KEY `IDX_WISHLIST_ITEM_PRODUCT_ID` (`product_id`),
  KEY `IDX_WISHLIST_ITEM_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Wishlist items';

INSERT INTO `#__wishlist_item` (`wishlist_item_id`, `wishlist_id`, `product_id`, `store_id`, `added_at`, `description`, `qty`) VALUES
(1, 2, 173, 1, '2012-08-14 07:13:57', NULL, '1.0000');

CREATE TABLE `#__wishlist_item_option` (
  `option_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Option Id',
  `wishlist_item_id` int(10) unsigned NOT NULL COMMENT 'Wishlist Item Id',
  `product_id` int(10) unsigned NOT NULL COMMENT 'Product Id',
  `code` varchar(255) NOT NULL COMMENT 'Code',
  `value` text COMMENT 'Value',
  PRIMARY KEY (`option_id`),
  KEY `FK_j502fa_FK_WISHLIST_ITEM_OPTION_ITEM_ID` (`wishlist_item_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8  COMMENT='Wishlist Item Option Table';

INSERT INTO `#__wishlist_item_option` (`option_id`, `wishlist_item_id`, `product_id`, `code`, `value`) VALUES
(1, 1, 173, 'info_buyRequest', 'a:4:{s:4:"uenc";s:76:"aHR0cDovLzEwLjAuMC4xMDIvam1fd29ya3Mvam1fdHJleC9pbmRleC5waHAvYmlrZXMuaHRtbA,,";s:7:"product";s:3:"173";s:3:"qty";i:1;s:12:"original_qty";i:1;}');

CREATE TABLE `#__xmlconnect_application` (
  `application_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Application Id',
  `name` varchar(255) NOT NULL COMMENT 'Application Name',
  `code` varchar(32) NOT NULL COMMENT 'Application Code',
  `type` varchar(32) NOT NULL COMMENT 'Device Type',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `active_from` date DEFAULT NULL COMMENT 'Active From',
  `active_to` date DEFAULT NULL COMMENT 'Active To',
  `updated_at` timestamp NULL DEFAULT NULL COMMENT 'Updated At',
  `status` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Status',
  `browsing_mode` smallint(5) unsigned DEFAULT '0' COMMENT 'Browsing Mode',
  PRIMARY KEY (`application_id`),
  UNIQUE KEY `UNQ_XMLCONNECT_APPLICATION_CODE` (`code`),
  KEY `FK_XMLCONNECT_APPLICATION_STORE_ID_CORE_STORE_STORE_ID` (`store_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Xmlconnect Application';


CREATE TABLE `#__xmlconnect_config_data` (
  `application_id` smallint(5) unsigned NOT NULL COMMENT 'Application Id',
  `category` varchar(60) NOT NULL DEFAULT 'default' COMMENT 'Category',
  `path` varchar(250) NOT NULL COMMENT 'Path',
  `value` text NOT NULL COMMENT 'Value',
  UNIQUE KEY `UNQ_XMLCONNECT_CONFIG_DATA_APPLICATION_ID_CATEGORY_PATH` (`application_id`,`category`,`path`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Xmlconnect Configuration Data';


CREATE TABLE `#__xmlconnect_history` (
  `history_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'History Id',
  `application_id` smallint(5) unsigned NOT NULL COMMENT 'Application Id',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `store_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Store Id',
  `params` blob COMMENT 'Params',
  `title` varchar(200) NOT NULL COMMENT 'Title',
  `activation_key` varchar(255) NOT NULL COMMENT 'Activation Key',
  `name` varchar(255) NOT NULL COMMENT 'Application Name',
  `code` varchar(32) NOT NULL COMMENT 'Application Code',
  PRIMARY KEY (`history_id`),
  KEY `FK_8F08B9513373BC19F49EE3EF8340E270` (`application_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Xmlconnect History';


CREATE TABLE `#__xmlconnect_images` (
  `image_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Image Id',
  `application_id` smallint(5) unsigned NOT NULL COMMENT 'Application Id',
  `image_file` varchar(255) NOT NULL COMMENT 'Image File',
  `image_type` varchar(255) NOT NULL COMMENT 'Image Type',
  `order` int(10) unsigned NOT NULL COMMENT 'Order',
  PRIMARY KEY (`image_id`),
  KEY `FK_6C55A623A089E4FEA9201FFE01693167` (`application_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Xmlconnect Images';


CREATE TABLE `#__xmlconnect_notification_template` (
  `template_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Template Id',
  `name` varchar(255) NOT NULL COMMENT 'Template Name',
  `push_title` varchar(140) NOT NULL COMMENT 'Push Notification Title',
  `message_title` varchar(255) NOT NULL COMMENT 'Message Title',
  `content` text NOT NULL COMMENT 'Message Content',
  `created_at` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `modified_at` timestamp NULL DEFAULT NULL COMMENT 'Modified At',
  `application_id` smallint(5) unsigned NOT NULL COMMENT 'Application Id',
  PRIMARY KEY (`template_id`),
  KEY `FK_F9927C7518A907CF5C350942FD296DC3` (`application_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Xmlconnect Notification Template';


CREATE TABLE `#__xmlconnect_queue` (
  `queue_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Queue Id',
  `create_time` timestamp NULL DEFAULT NULL COMMENT 'Created At',
  `exec_time` timestamp NULL DEFAULT NULL COMMENT 'Scheduled Execution Time',
  `template_id` int(10) unsigned NOT NULL COMMENT 'Template Id',
  `push_title` varchar(140) NOT NULL COMMENT 'Push Notification Title',
  `message_title` varchar(255) DEFAULT '' COMMENT 'Message Title',
  `content` text COMMENT 'Message Content',
  `status` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Status',
  `type` varchar(12) NOT NULL COMMENT 'Type of Notification',
  PRIMARY KEY (`queue_id`),
  KEY `FK_j502fa_FK_TEMPLATE_ID` (`template_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Xmlconnect Notification Queue';

ALTER TABLE `#__admin_rule`
  ADD CONSTRAINT `#__FK_ADMIN_RULE_ROLE_ID_ADMIN_ROLE_ROLE_ID` FOREIGN KEY (`role_id`) REFERENCES `#__admin_role` (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__api2_acl_rule`
  ADD CONSTRAINT `#__FK_API2_ACL_RULE_ROLE_ID_API2_ACL_ROLE` FOREIGN KEY (`role_id`) REFERENCES `#__api2_acl_role` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__api2_acl_user`
  ADD CONSTRAINT `#__FK_API2_ACL_USER_ADMIN_ID_ADMIN_USER_USER_ID` FOREIGN KEY (`admin_id`) REFERENCES `#__admin_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_API2_ACL_USER_ROLE_ID_API2_ACL_ROLE` FOREIGN KEY (`role_id`) REFERENCES `#__api2_acl_role` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__api_rule`
  ADD CONSTRAINT `#__FK_API_RULE_ROLE_ID_API_ROLE_ROLE_ID` FOREIGN KEY (`role_id`) REFERENCES `#__api_role` (`role_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__api_session`
  ADD CONSTRAINT `#__FK_API_SESSION_USER_ID_API_USER_USER_ID` FOREIGN KEY (`user_id`) REFERENCES `#__api_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_category_entity_datetime`
  ADD CONSTRAINT `#__FK_CATALOG_CATEGORY_ENTITY_DATETIME_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_ENTT_DTIME_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_ENTT_DTIME_ENTT_ID_CAT_CTGR_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_category_entity_decimal`
  ADD CONSTRAINT `#__FK_CATALOG_CATEGORY_ENTITY_DECIMAL_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_ENTT_DEC_ENTT_ID_CAT_CTGR_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_category_entity_int`
  ADD CONSTRAINT `#__FK_CATALOG_CATEGORY_ENTITY_INT_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_ENTT_INT_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_ENTT_INT_ENTT_ID_CAT_CTGR_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_category_entity_text`
  ADD CONSTRAINT `#__FK_CATALOG_CATEGORY_ENTITY_TEXT_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_ENTT_TEXT_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_ENTT_TEXT_ENTT_ID_CAT_CTGR_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_category_entity_varchar`
  ADD CONSTRAINT `#__FK_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_ENTT_VCHR_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_ENTT_VCHR_ENTT_ID_CAT_CTGR_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_category_flat_store_1`
  ADD CONSTRAINT `#__FK_CATALOG_CATEGORY_FLAT_STORE_1_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_FLAT_STORE_1_ENTT_ID_CAT_CTGR` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_category_flat_store_2`
  ADD CONSTRAINT `#__FK_CATALOG_CATEGORY_FLAT_STORE_2_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_FLAT_STORE_2_ENTT_ID_CAT_CTGR` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_category_flat_store_3`
  ADD CONSTRAINT `#__FK_CATALOG_CATEGORY_FLAT_STORE_3_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_FLAT_STORE_3_ENTT_ID_CAT_CTGR` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_category_product`
  ADD CONSTRAINT `#__FK_CAT_CTGR_PRD_CTGR_ID_CAT_CTGR_ENTT_ENTT` FOREIGN KEY (`category_id`) REFERENCES `#__catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_PRD_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_category_product_index`
  ADD CONSTRAINT `#__FK_CATALOG_CATEGORY_PRODUCT_INDEX_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_PRD_IDX_CTGR_ID_CAT_CTGR_ENTT` FOREIGN KEY (`category_id`) REFERENCES `#__catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CTGR_PRD_IDX_PRD_ID_CAT_PRD_ENTT_ENTT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_compare_item`
  ADD CONSTRAINT `#__FK_CATALOG_COMPARE_ITEM_CUSTOMER_ID_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATALOG_COMPARE_ITEM_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_CMP_ITEM_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_eav_attribute`
  ADD CONSTRAINT `#__FK_CATALOG_EAV_ATTRIBUTE_ATTRIBUTE_ID_EAV` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_bundle_option`
  ADD CONSTRAINT `#__FK_CAT_PRD_BNDL_OPT_PARENT_ID_CAT_PRD_ENTT` FOREIGN KEY (`parent_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_bundle_option_value`
  ADD CONSTRAINT `#__FK_CAT_PRD_BNDL_OPT_VAL_OPT_ID_CAT_PRD_BNDL` FOREIGN KEY (`option_id`) REFERENCES `#__catalog_product_bundle_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_bundle_price_index`
  ADD CONSTRAINT `#__FK_CAT_PRD_BNDL_PRICE_IDX_CSTR_GROUP_ID_CSTR` FOREIGN KEY (`customer_group_id`) REFERENCES `#__customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_BNDL_PRICE_IDX_ENTT_ID_CAT_PRD` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_BNDL_PRICE_IDX_WS_ID_CORE_WS_WS` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_bundle_selection`
  ADD CONSTRAINT `#__FK_CAT_PRD_BNDL_SELECTION_OPT_ID_CAT_PRD` FOREIGN KEY (`option_id`) REFERENCES `#__catalog_product_bundle_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_BNDL_SELECTION_PRD_ID_CAT_PRD` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_bundle_selection_price`
  ADD CONSTRAINT `#__FK_CAT_PRD_BNDL_SELECTION_PRICE_WS_ID_CORE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_DCF37523AA05D770A70AA4ED7C2616E4` FOREIGN KEY (`selection_id`) REFERENCES `#__catalog_product_bundle_selection` (`selection_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_enabled_index`
  ADD CONSTRAINT `#__FK_CATALOG_PRODUCT_ENABLED_INDEX_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENABLED_IDX_PRD_ID_CAT_PRD_ENTT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_entity`
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET` FOREIGN KEY (`attribute_set_id`) REFERENCES `#__eav_attribute_set` (`attribute_set_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_ENTT_TYPE_ID_EAV_ENTT_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_entity_datetime`
  ADD CONSTRAINT `#__FK_CATALOG_PRODUCT_ENTITY_DATETIME_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_DTIME_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_DTIME_ENTT_ID_CAT_PRD_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_entity_decimal`
  ADD CONSTRAINT `#__FK_CATALOG_PRODUCT_ENTITY_DECIMAL_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_DEC_ENTT_ID_CAT_PRD_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_entity_gallery`
  ADD CONSTRAINT `#__FK_CATALOG_PRODUCT_ENTITY_GALLERY_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_GLR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_GLR_ENTT_ID_CAT_PRD_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_entity_group_price`
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_GROUP_PRICE_ENTT_ID_CAT_PRD` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_GROUP_PRICE_WS_ID_CORE_WS_WS` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_DF909D22C11B60B1E5E3EE64AB220ECE` FOREIGN KEY (`customer_group_id`) REFERENCES `#__customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_entity_int`
  ADD CONSTRAINT `#__FK_CATALOG_PRODUCT_ENTITY_INT_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_INT_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_INT_ENTT_ID_CAT_PRD_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_entity_media_gallery`
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_MDA_GLR_ATTR_ID_EAV_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_MDA_GLR_ENTT_ID_CAT_PRD_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_entity_media_gallery_value`
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_MDA_GLR_VAL_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_MDA_GLR_VAL_VAL_ID_CAT_PRD` FOREIGN KEY (`value_id`) REFERENCES `#__catalog_product_entity_media_gallery` (`value_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_entity_text`
  ADD CONSTRAINT `#__FK_CATALOG_PRODUCT_ENTITY_TEXT_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_TEXT_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_TEXT_ENTT_ID_CAT_PRD_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_entity_tier_price`
  ADD CONSTRAINT `#__FK_6E08D719F0501DD1D8E6D4EFF2511C85` FOREIGN KEY (`customer_group_id`) REFERENCES `#__customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_TIER_PRICE_ENTT_ID_CAT_PRD` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_TIER_PRICE_WS_ID_CORE_WS_WS` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_entity_varchar`
  ADD CONSTRAINT `#__FK_CATALOG_PRODUCT_ENTITY_VARCHAR_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_VCHR_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_ENTT_VCHR_ENTT_ID_CAT_PRD_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_flat_1`
  ADD CONSTRAINT `#__FK_CAT_PRD_FLAT_1_ENTT_ID_CAT_PRD_ENTT_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_flat_2`
  ADD CONSTRAINT `#__FK_CAT_PRD_FLAT_2_ENTT_ID_CAT_PRD_ENTT_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_flat_3`
  ADD CONSTRAINT `#__FK_CAT_PRD_FLAT_3_ENTT_ID_CAT_PRD_ENTT_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_index_eav`
  ADD CONSTRAINT `#__FK_CATALOG_PRODUCT_INDEX_EAV_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_EAV_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_EAV_ENTT_ID_CAT_PRD_ENTT_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_index_eav_decimal`
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_EAV_DEC_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_EAV_DEC_ENTT_ID_CAT_PRD_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_EAV_DEC_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_index_group_price`
  ADD CONSTRAINT `#__FK_195DF97C81B0BDD6A2EEC50F870E16D1` FOREIGN KEY (`customer_group_id`) REFERENCES `#__customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_GROUP_PRICE_ENTT_ID_CAT_PRD` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_GROUP_PRICE_WS_ID_CORE_WS_WS` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_index_price`
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_PRICE_CSTR_GROUP_ID_CSTR` FOREIGN KEY (`customer_group_id`) REFERENCES `#__customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_PRICE_ENTT_ID_CAT_PRD_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_PRICE_WS_ID_CORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_index_tier_price`
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_TIER_PRICE_CSTR_GROUP_ID_CSTR` FOREIGN KEY (`customer_group_id`) REFERENCES `#__customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_TIER_PRICE_ENTT_ID_CAT_PRD` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_TIER_PRICE_WS_ID_CORE_WS_WS` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_index_website`
  ADD CONSTRAINT `#__FK_CAT_PRD_IDX_WS_WS_ID_CORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_link`
  ADD CONSTRAINT `#__FK_CAT_PRD_LNK_LNKED_PRD_ID_CAT_PRD_ENTT` FOREIGN KEY (`linked_product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_LNK_LNK_TYPE_ID_CAT_PRD_LNK_TYPE` FOREIGN KEY (`link_type_id`) REFERENCES `#__catalog_product_link_type` (`link_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_LNK_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_link_attribute`
  ADD CONSTRAINT `#__FK_CAT_PRD_LNK_ATTR_LNK_TYPE_ID_CAT_PRD_LNK` FOREIGN KEY (`link_type_id`) REFERENCES `#__catalog_product_link_type` (`link_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_link_attribute_decimal`
  ADD CONSTRAINT `#__FK_AB2EFA9A14F7BCF1D5400056203D14B6` FOREIGN KEY (`product_link_attribute_id`) REFERENCES `#__catalog_product_link_attribute` (`product_link_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_LNK_ATTR_DEC_LNK_ID_CAT_PRD_LNK` FOREIGN KEY (`link_id`) REFERENCES `#__catalog_product_link` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_link_attribute_int`
  ADD CONSTRAINT `#__FK_CAT_PRD_LNK_ATTR_INT_LNK_ID_CAT_PRD_LNK` FOREIGN KEY (`link_id`) REFERENCES `#__catalog_product_link` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_D6D878F8BA2A4282F8DDED7E6E3DE35C` FOREIGN KEY (`product_link_attribute_id`) REFERENCES `#__catalog_product_link_attribute` (`product_link_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_link_attribute_varchar`
  ADD CONSTRAINT `#__FK_CAT_PRD_LNK_ATTR_VCHR_LNK_ID_CAT_PRD_LNK` FOREIGN KEY (`link_id`) REFERENCES `#__catalog_product_link` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_DEE9C4DA61CFCC01DFCF50F0D79CEA51` FOREIGN KEY (`product_link_attribute_id`) REFERENCES `#__catalog_product_link_attribute` (`product_link_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_option`
  ADD CONSTRAINT `#__FK_CAT_PRD_OPT_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_option_price`
  ADD CONSTRAINT `#__FK_CATALOG_PRODUCT_OPTION_PRICE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_OPT_PRICE_OPT_ID_CAT_PRD_OPT_OPT` FOREIGN KEY (`option_id`) REFERENCES `#__catalog_product_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_option_title`
  ADD CONSTRAINT `#__FK_CATALOG_PRODUCT_OPTION_TITLE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_OPT_TTL_OPT_ID_CAT_PRD_OPT_OPT_ID` FOREIGN KEY (`option_id`) REFERENCES `#__catalog_product_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_option_type_price`
  ADD CONSTRAINT `#__FK_B523E3378E8602F376CC415825576B7F` FOREIGN KEY (`option_type_id`) REFERENCES `#__catalog_product_option_type_value` (`option_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_OPT_TYPE_PRICE_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_option_type_title`
  ADD CONSTRAINT `#__FK_C085B9CF2C2A302E8043FDEA1937D6A2` FOREIGN KEY (`option_type_id`) REFERENCES `#__catalog_product_option_type_value` (`option_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_OPT_TYPE_TTL_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_option_type_value`
  ADD CONSTRAINT `#__FK_CAT_PRD_OPT_TYPE_VAL_OPT_ID_CAT_PRD_OPT` FOREIGN KEY (`option_id`) REFERENCES `#__catalog_product_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_relation`
  ADD CONSTRAINT `#__FK_CAT_PRD_RELATION_CHILD_ID_CAT_PRD_ENTT` FOREIGN KEY (`child_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_RELATION_PARENT_ID_CAT_PRD_ENTT` FOREIGN KEY (`parent_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_super_attribute`
  ADD CONSTRAINT `#__FK_CAT_PRD_SPR_ATTR_PRD_ID_CAT_PRD_ENTT_ENTT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE `#__catalog_product_super_attribute_label`
  ADD CONSTRAINT `#__FK_309442281DF7784210ED82B2CC51E5D5` FOREIGN KEY (`product_super_attribute_id`) REFERENCES `#__catalog_product_super_attribute` (`product_super_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_SPR_ATTR_LBL_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_super_attribute_pricing`
  ADD CONSTRAINT `#__FK_CAT_PRD_SPR_ATTR_PRICING_WS_ID_CORE_WS_WS` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CDE8813117106CFAA3AD209358F66332` FOREIGN KEY (`product_super_attribute_id`) REFERENCES `#__catalog_product_super_attribute` (`product_super_attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_super_link`
  ADD CONSTRAINT `#__FK_CAT_PRD_SPR_LNK_PARENT_ID_CAT_PRD_ENTT` FOREIGN KEY (`parent_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_SPR_LNK_PRD_ID_CAT_PRD_ENTT_ENTT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalog_product_website`
  ADD CONSTRAINT `#__FK_CATALOG_PRODUCT_WEBSITE_WEBSITE_ID_CORE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CAT_PRD_WS_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__cataloginventory_stock_item`
  ADD CONSTRAINT `#__FK_CATINV_STOCK_ITEM_PRD_ID_CAT_PRD_ENTT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATINV_STOCK_ITEM_STOCK_ID_CATINV_STOCK` FOREIGN KEY (`stock_id`) REFERENCES `#__cataloginventory_stock` (`stock_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__cataloginventory_stock_status`
  ADD CONSTRAINT `#__FK_CATINV_STOCK_STS_PRD_ID_CAT_PRD_ENTT_ENTT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATINV_STOCK_STS_STOCK_ID_CATINV_STOCK` FOREIGN KEY (`stock_id`) REFERENCES `#__cataloginventory_stock` (`stock_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATINV_STOCK_STS_WS_ID_CORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalogrule_customer_group`
  ADD CONSTRAINT `#__FK_CATALOGRULE_CUSTOMER_GROUP_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `#__catalogrule` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATRULE_CSTR_GROUP_CSTR_GROUP_ID_CSTR` FOREIGN KEY (`customer_group_id`) REFERENCES `#__customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalogrule_group_website`
  ADD CONSTRAINT `#__FK_CATALOGRULE_GROUP_WEBSITE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `#__catalogrule` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATALOGRULE_GROUP_WEBSITE_WEBSITE_ID_CORE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATRULE_GROUP_WS_CSTR_GROUP_ID_CSTR_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `#__customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalogrule_product`
  ADD CONSTRAINT `#__FK_CATALOGRULE_PRODUCT_RULE_ID_CATALOGRULE` FOREIGN KEY (`rule_id`) REFERENCES `#__catalogrule` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATALOGRULE_PRODUCT_WEBSITE_ID_CORE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATRULE_PRD_CSTR_GROUP_ID_CSTR_GROUP_CSTR` FOREIGN KEY (`customer_group_id`) REFERENCES `#__customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATRULE_PRD_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalogrule_product_price`
  ADD CONSTRAINT `#__FK_CATALOGRULE_PRODUCT_PRICE_WEBSITE_ID_CORE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATRULE_PRD_PRICE_CSTR_GROUP_ID_CSTR` FOREIGN KEY (`customer_group_id`) REFERENCES `#__customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATRULE_PRD_PRICE_PRD_ID_CAT_PRD_ENTT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalogrule_website`
  ADD CONSTRAINT `#__FK_CATALOGRULE_WEBSITE_RULE_ID_CATALOGRULE` FOREIGN KEY (`rule_id`) REFERENCES `#__catalogrule` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATALOGRULE_WEBSITE_WEBSITE_ID_CORE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalogsearch_query`
  ADD CONSTRAINT `#__FK_CATALOGSEARCH_QUERY_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__catalogsearch_result`
  ADD CONSTRAINT `#__FK_CATALOGSEARCH_RESULT_QUERY_ID` FOREIGN KEY (`query_id`) REFERENCES `#__catalogsearch_query` (`query_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CATSRCH_RESULT_PRD_ID_CAT_PRD_ENTT_ENTT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__checkout_agreement_store`
  ADD CONSTRAINT `#__FK_CHECKOUT_AGREEMENT_STORE_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CHKT_AGRT_STORE_AGRT_ID_CHKT_AGRT_AGRT_ID` FOREIGN KEY (`agreement_id`) REFERENCES `#__checkout_agreement` (`agreement_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__cms_block_store`
  ADD CONSTRAINT `#__FK_CMS_BLOCK_STORE_BLOCK_ID_CMS_BLOCK_BLOCK` FOREIGN KEY (`block_id`) REFERENCES `#__cms_block` (`block_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CMS_BLOCK_STORE_STORE_ID_CORE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__cms_page_store`
  ADD CONSTRAINT `#__FK_CMS_PAGE_STORE_PAGE_ID_CMS_PAGE_PAGE_ID` FOREIGN KEY (`page_id`) REFERENCES `#__cms_page` (`page_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CMS_PAGE_STORE_STORE_ID_CORE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__core_email_queue_recipients`
  ADD CONSTRAINT `#__FK_1A3EE25B01095981F1C7F2D08F879786` FOREIGN KEY (`message_id`) REFERENCES `#__core_email_queue` (`message_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__core_layout_link`
  ADD CONSTRAINT `#__FK_CORE_LAYOUT_LINK_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CORE_LYT_LNK_LYT_UPDATE_ID_CORE_LYT` FOREIGN KEY (`layout_update_id`) REFERENCES `#__core_layout_update` (`layout_update_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__core_store`
  ADD CONSTRAINT `#__FK_CORE_STORE_GROUP_ID_CORE_STORE_GROUP` FOREIGN KEY (`group_id`) REFERENCES `#__core_store_group` (`group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CORE_STORE_WEBSITE_ID_CORE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__core_store_group`
  ADD CONSTRAINT `#__FK_CORE_STORE_GROUP_WEBSITE_ID_CORE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__core_translate`
  ADD CONSTRAINT `#__FK_CORE_TRANSLATE_STORE_ID_CORE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__core_url_rewrite`
  ADD CONSTRAINT `#__FK_CORE_URL_REWRITE_CTGR_ID_CAT_CTGR_ENTT` FOREIGN KEY (`category_id`) REFERENCES `#__catalog_category_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CORE_URL_REWRITE_PRODUCT_ID_CATALOG` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CORE_URL_REWRITE_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__core_variable_value`
  ADD CONSTRAINT `#__FK_CORE_VARIABLE_VALUE_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CORE_VARIABLE_VALUE_VARIABLE_ID_CORE` FOREIGN KEY (`variable_id`) REFERENCES `#__core_variable` (`variable_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__coupon_aggregated`
  ADD CONSTRAINT `#__FK_COUPON_AGGREGATED_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__coupon_aggregated_order`
  ADD CONSTRAINT `#__FK_COUPON_AGGREGATED_ORDER_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__coupon_aggregated_updated`
  ADD CONSTRAINT `#__FK_COUPON_AGGREGATED_UPDATED_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_address_entity`
  ADD CONSTRAINT `#__FK_CUSTOMER_ADDRESS_ENTITY_PARENT_ID` FOREIGN KEY (`parent_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_address_entity_datetime`
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_DTIME_ATTR_ID_EAV_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_DTIME_ENTT_ID_CSTR_ADDR` FOREIGN KEY (`entity_id`) REFERENCES `#__customer_address_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_DTIME_ENTT_TYPE_ID_EAV` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_address_entity_decimal`
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_DEC_ENTT_ID_CSTR_ADDR_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__customer_address_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_DEC_ENTT_TYPE_ID_EAV_ENTT` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_address_entity_int`
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_INT_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_INT_ENTT_ID_CSTR_ADDR_ENTT` FOREIGN KEY (`entity_id`) REFERENCES `#__customer_address_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_INT_ENTT_TYPE_ID_EAV_ENTT` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_address_entity_text`
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_TEXT_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_TEXT_ENTT_ID_CSTR_ADDR` FOREIGN KEY (`entity_id`) REFERENCES `#__customer_address_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_TEXT_ENTT_TYPE_ID_EAV_ENTT` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_address_entity_varchar`
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_VCHR_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_VCHR_ENTT_ID_CSTR_ADDR` FOREIGN KEY (`entity_id`) REFERENCES `#__customer_address_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_ADDR_ENTT_VCHR_ENTT_TYPE_ID_EAV_ENTT` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_eav_attribute`
  ADD CONSTRAINT `#__FK_CSTR_EAV_ATTR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_eav_attribute_website`
  ADD CONSTRAINT `#__FK_CSTR_EAV_ATTR_WS_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_EAV_ATTR_WS_WS_ID_CORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_entity`
  ADD CONSTRAINT `#__FK_CUSTOMER_ENTITY_STORE_ID_CORE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CUSTOMER_ENTITY_WEBSITE_ID_CORE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__customer_entity_datetime`
  ADD CONSTRAINT `#__FK_CSTR_ENTT_DTIME_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_ENTT_DTIME_ENTT_TYPE_ID_EAV_ENTT` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CUSTOMER_ENTITY_DATETIME_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_entity_decimal`
  ADD CONSTRAINT `#__FK_CSTR_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_ENTT_DEC_ENTT_TYPE_ID_EAV_ENTT_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CUSTOMER_ENTITY_DECIMAL_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_entity_int`
  ADD CONSTRAINT `#__FK_CSTR_ENTT_INT_ENTT_TYPE_ID_EAV_ENTT_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CUSTOMER_ENTITY_INT_ATTRIBUTE_ID_EAV` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CUSTOMER_ENTITY_INT_ENTITY_ID_CUSTOMER` FOREIGN KEY (`entity_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_entity_text`
  ADD CONSTRAINT `#__FK_CSTR_ENTT_TEXT_ENTT_TYPE_ID_EAV_ENTT_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CUSTOMER_ENTITY_TEXT_ATTRIBUTE_ID_EAV` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CUSTOMER_ENTITY_TEXT_ENTITY_ID_CUSTOMER` FOREIGN KEY (`entity_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_entity_varchar`
  ADD CONSTRAINT `#__FK_CSTR_ENTT_VCHR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CSTR_ENTT_VCHR_ENTT_TYPE_ID_EAV_ENTT_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_CUSTOMER_ENTITY_VARCHAR_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__customer_form_attribute`
  ADD CONSTRAINT `#__FK_CSTR_FORM_ATTR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__dataflow_batch`
  ADD CONSTRAINT `#__FK_DATAFLOW_BATCH_PROFILE_ID_DATAFLOW` FOREIGN KEY (`profile_id`) REFERENCES `#__dataflow_profile` (`profile_id`) ON DELETE CASCADE ON UPDATE NO ACTION,
  ADD CONSTRAINT `#__FK_DATAFLOW_BATCH_STORE_ID_CORE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE `#__dataflow_batch_export`
  ADD CONSTRAINT `#__FK_DATAFLOW_BATCH_EXPORT_BATCH_ID_DATAFLOW` FOREIGN KEY (`batch_id`) REFERENCES `#__dataflow_batch` (`batch_id`) ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE `#__dataflow_batch_import`
  ADD CONSTRAINT `#__FK_DATAFLOW_BATCH_IMPORT_BATCH_ID_DATAFLOW` FOREIGN KEY (`batch_id`) REFERENCES `#__dataflow_batch` (`batch_id`) ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE `#__dataflow_import_data`
  ADD CONSTRAINT `#__FK_DATAFLOW_IMPORT_DATA_SESSION_ID_DATAFLOW` FOREIGN KEY (`session_id`) REFERENCES `#__dataflow_session` (`session_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
ALTER TABLE `#__dataflow_profile_history`
  ADD CONSTRAINT `#__FK_AEA06B0C500063D3CE6EA671AE776645` FOREIGN KEY (`profile_id`) REFERENCES `#__dataflow_profile` (`profile_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__design_change`
  ADD CONSTRAINT `#__FK_DESIGN_CHANGE_STORE_ID_CORE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__directory_country_region_name`
  ADD CONSTRAINT `#__FK_D7CFDEB379F775328EB6F62695E2B3E1` FOREIGN KEY (`region_id`) REFERENCES `#__directory_country_region` (`region_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__downloadable_link`
  ADD CONSTRAINT `#__FK_DOWNLOADABLE_LINK_PRODUCT_ID_CATALOG` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__downloadable_link_price`
  ADD CONSTRAINT `#__FK_DOWNLOADABLE_LINK_PRICE_LINK_ID` FOREIGN KEY (`link_id`) REFERENCES `#__downloadable_link` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_DOWNLOADABLE_LINK_PRICE_WEBSITE_ID_CORE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__downloadable_link_purchased`
  ADD CONSTRAINT `#__FK_DL_LNK_PURCHASED_CSTR_ID_CSTR_ENTT_ENTT` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_DL_LNK_PURCHASED_ORDER_ID_SALES_FLAT` FOREIGN KEY (`order_id`) REFERENCES `#__sales_flat_order` (`entity_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__downloadable_link_purchased_item`
  ADD CONSTRAINT `#__FK_46CC8E252307CE62F00A8F1887512A39` FOREIGN KEY (`purchased_id`) REFERENCES `#__downloadable_link_purchased` (`purchased_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_B219BF25756700DEE44550B21220ECCE` FOREIGN KEY (`order_item_id`) REFERENCES `#__sales_flat_order_item` (`item_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__downloadable_link_title`
  ADD CONSTRAINT `#__FK_DOWNLOADABLE_LINK_TITLE_LINK_ID` FOREIGN KEY (`link_id`) REFERENCES `#__downloadable_link` (`link_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_DOWNLOADABLE_LINK_TITLE_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__downloadable_sample`
  ADD CONSTRAINT `#__FK_DL_SAMPLE_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__downloadable_sample_title`
  ADD CONSTRAINT `#__FK_DL_SAMPLE_TTL_SAMPLE_ID_DL_SAMPLE_SAMPLE` FOREIGN KEY (`sample_id`) REFERENCES `#__downloadable_sample` (`sample_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_DOWNLOADABLE_SAMPLE_TITLE_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_attribute`
  ADD CONSTRAINT `#__FK_EAV_ATTRIBUTE_ENTITY_TYPE_ID_EAV_ENTITY` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_attribute_group`
  ADD CONSTRAINT `#__FK_EAV_ATTR_GROUP_ATTR_SET_ID_EAV_ATTR_SET` FOREIGN KEY (`attribute_set_id`) REFERENCES `#__eav_attribute_set` (`attribute_set_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_attribute_label`
  ADD CONSTRAINT `#__FK_EAV_ATTRIBUTE_LABEL_ATTRIBUTE_ID_EAV` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ATTRIBUTE_LABEL_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_attribute_option`
  ADD CONSTRAINT `#__FK_EAV_ATTRIBUTE_OPTION_ATTRIBUTE_ID_EAV` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_attribute_option_value`
  ADD CONSTRAINT `#__FK_EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ATTR_OPT_VAL_OPT_ID_EAV_ATTR_OPT_OPT` FOREIGN KEY (`option_id`) REFERENCES `#__eav_attribute_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_attribute_set`
  ADD CONSTRAINT `#__FK_EAV_ATTR_SET_ENTT_TYPE_ID_EAV_ENTT_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_entity`
  ADD CONSTRAINT `#__FK_EAV_ENTITY_ENTITY_TYPE_ID_EAV_ENTITY_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ENTITY_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_entity_attribute`
  ADD CONSTRAINT `#__FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_ID_EAV` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ENTT_ATTR_ATTR_GROUP_ID_EAV_ATTR` FOREIGN KEY (`attribute_group_id`) REFERENCES `#__eav_attribute_group` (`attribute_group_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_entity_datetime`
  ADD CONSTRAINT `#__FK_EAV_ENTITY_DATETIME_ENTITY_ID_EAV_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `#__eav_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ENTITY_DATETIME_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ENTT_DTIME_ENTT_TYPE_ID_EAV_ENTT_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_entity_decimal`
  ADD CONSTRAINT `#__FK_EAV_ENTITY_DECIMAL_ENTITY_ID_EAV_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `#__eav_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ENTITY_DECIMAL_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ENTT_DEC_ENTT_TYPE_ID_EAV_ENTT_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_entity_int`
  ADD CONSTRAINT `#__FK_EAV_ENTITY_INT_ENTITY_ID_EAV_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `#__eav_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ENTITY_INT_ENTITY_TYPE_ID_EAV_ENTITY` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ENTITY_INT_STORE_ID_CORE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_entity_store`
  ADD CONSTRAINT `#__FK_EAV_ENTITY_STORE_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ENTT_STORE_ENTT_TYPE_ID_EAV_ENTT_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_entity_text`
  ADD CONSTRAINT `#__FK_EAV_ENTITY_TEXT_ENTITY_ID_EAV_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `#__eav_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ENTITY_TEXT_ENTITY_TYPE_ID_EAV_ENTITY` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ENTITY_TEXT_STORE_ID_CORE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_entity_varchar`
  ADD CONSTRAINT `#__FK_EAV_ENTITY_VARCHAR_ENTITY_ID_EAV_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `#__eav_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ENTITY_VARCHAR_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_ENTT_VCHR_ENTT_TYPE_ID_EAV_ENTT_TYPE` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_form_element`
  ADD CONSTRAINT `#__FK_EAV_FORM_ELEMENT_ATTRIBUTE_ID_EAV` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_FORM_ELEMENT_FIELDSET_ID_EAV_FORM` FOREIGN KEY (`fieldset_id`) REFERENCES `#__eav_form_fieldset` (`fieldset_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_FORM_ELEMENT_TYPE_ID_EAV_FORM_TYPE` FOREIGN KEY (`type_id`) REFERENCES `#__eav_form_type` (`type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_form_fieldset`
  ADD CONSTRAINT `#__FK_EAV_FORM_FIELDSET_TYPE_ID_EAV_FORM_TYPE` FOREIGN KEY (`type_id`) REFERENCES `#__eav_form_type` (`type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_form_fieldset_label`
  ADD CONSTRAINT `#__FK_EAV_FORM_FIELDSET_LABEL_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_FORM_FSET_LBL_FSET_ID_EAV_FORM_FSET` FOREIGN KEY (`fieldset_id`) REFERENCES `#__eav_form_fieldset` (`fieldset_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_form_type`
  ADD CONSTRAINT `#__FK_EAV_FORM_TYPE_STORE_ID_CORE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__eav_form_type_entity`
  ADD CONSTRAINT `#__FK_EAV_FORM_TYPE_ENTITY_TYPE_ID_EAV_FORM` FOREIGN KEY (`type_id`) REFERENCES `#__eav_form_type` (`type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_EAV_FORM_TYPE_ENTT_ENTT_TYPE_ID_EAV_ENTT` FOREIGN KEY (`entity_type_id`) REFERENCES `#__eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__googlebase_attributes`
  ADD CONSTRAINT `#__FK_GOOGLEBASE_ATTRIBUTES_ATTRIBUTE_ID_EAV` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE NO ACTION,
  ADD CONSTRAINT `#__FK_GOOGLEBASE_ATTRIBUTES_TYPE_ID_GOOGLEBASE` FOREIGN KEY (`type_id`) REFERENCES `#__googlebase_types` (`type_id`) ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE `#__googlebase_items`
  ADD CONSTRAINT `#__FK_GOOGLEBASE_ITEMS_PRODUCT_ID_CATALOG` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE NO ACTION,
  ADD CONSTRAINT `#__FK_GOOGLEBASE_ITEMS_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE `#__googlebase_types`
  ADD CONSTRAINT `#__FK_GOOGLEBASE_TYPES_ATTR_SET_ID_EAV_ATTR_SET` FOREIGN KEY (`attribute_set_id`) REFERENCES `#__eav_attribute_set` (`attribute_set_id`) ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE `#__googleoptimizer_code`
  ADD CONSTRAINT `#__FK_GOOGLEOPTIMIZER_CODE_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__index_process_event`
  ADD CONSTRAINT `#__FK_INDEX_PROCESS_EVENT_EVENT_ID_INDEX_EVENT` FOREIGN KEY (`event_id`) REFERENCES `#__index_event` (`event_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_INDEX_PROCESS_EVENT_PROCESS_ID_INDEX` FOREIGN KEY (`process_id`) REFERENCES `#__index_process` (`process_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__newsletter_problem`
  ADD CONSTRAINT `#__FK_NEWSLETTER_PROBLEM_QUEUE_ID_NEWSLETTER` FOREIGN KEY (`queue_id`) REFERENCES `#__newsletter_queue` (`queue_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_NLTTR_PROBLEM_SUBSCRIBER_ID_NLTTR` FOREIGN KEY (`subscriber_id`) REFERENCES `#__newsletter_subscriber` (`subscriber_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__newsletter_queue`
  ADD CONSTRAINT `#__FK_NEWSLETTER_QUEUE_TEMPLATE_ID_NEWSLETTER` FOREIGN KEY (`template_id`) REFERENCES `#__newsletter_template` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__newsletter_queue_link`
  ADD CONSTRAINT `#__FK_NEWSLETTER_QUEUE_LINK_QUEUE_ID_NEWSLETTER` FOREIGN KEY (`queue_id`) REFERENCES `#__newsletter_queue` (`queue_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_NLTTR_QUEUE_LNK_SUBSCRIBER_ID_NLTTR` FOREIGN KEY (`subscriber_id`) REFERENCES `#__newsletter_subscriber` (`subscriber_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__newsletter_queue_store_link`
  ADD CONSTRAINT `#__FK_NEWSLETTER_QUEUE_STORE_LINK_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_NLTTR_QUEUE_STORE_LNK_QUEUE_ID_NLTTR` FOREIGN KEY (`queue_id`) REFERENCES `#__newsletter_queue` (`queue_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__newsletter_subscriber`
  ADD CONSTRAINT `#__FK_NEWSLETTER_SUBSCRIBER_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__oauth_token`
  ADD CONSTRAINT `#__FK_OAUTH_TOKEN_ADMIN_ID_ADMIN_USER_USER_ID` FOREIGN KEY (`admin_id`) REFERENCES `#__admin_user` (`user_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_OAUTH_TOKEN_CONSUMER_ID_OAUTH_CONSUMER` FOREIGN KEY (`consumer_id`) REFERENCES `#__oauth_consumer` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_OAUTH_TOKEN_CUSTOMER_ID_CUSTOMER_ENTITY` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__paypal_cert`
  ADD CONSTRAINT `#__FK_PAYPAL_CERT_WEBSITE_ID_CORE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__paypal_settlement_report_row`
  ADD CONSTRAINT `#__FK_E183E488F593E0DE10C6EBFFEBAC9B55` FOREIGN KEY (`report_id`) REFERENCES `#__paypal_settlement_report` (`report_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__persistent_session`
  ADD CONSTRAINT `#__FK_PERSISTENT_SESSION_CUSTOMER_ID_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE NO ACTION,
  ADD CONSTRAINT `#__FK_PERSISTENT_SESSION_WEBSITE_ID_CORE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE `#__poll`
  ADD CONSTRAINT `#__FK_POLL_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__poll_answer`
  ADD CONSTRAINT `#__FK_POLL_ANSWER_POLL_ID_POLL_POLL_ID` FOREIGN KEY (`poll_id`) REFERENCES `#__poll` (`poll_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__poll_store`
  ADD CONSTRAINT `#__FK_POLL_STORE_POLL_ID_POLL_POLL_ID` FOREIGN KEY (`poll_id`) REFERENCES `#__poll` (`poll_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_POLL_STORE_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__poll_vote`
  ADD CONSTRAINT `#__FK_POLL_VOTE_POLL_ANSWER_ID_POLL_ANSWER` FOREIGN KEY (`poll_answer_id`) REFERENCES `#__poll_answer` (`answer_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__product_alert_price`
  ADD CONSTRAINT `#__FK_PRD_ALERT_PRICE_PRD_ID_CAT_PRD_ENTT_ENTT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_PRODUCT_ALERT_PRICE_CUSTOMER_ID_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_PRODUCT_ALERT_PRICE_WEBSITE_ID_CORE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__product_alert_stock`
  ADD CONSTRAINT `#__FK_PRD_ALERT_STOCK_PRD_ID_CAT_PRD_ENTT_ENTT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_PRODUCT_ALERT_STOCK_CUSTOMER_ID_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_PRODUCT_ALERT_STOCK_WEBSITE_ID_CORE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__rating`
  ADD CONSTRAINT `#__FK_RATING_ENTITY_ID_RATING_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `#__rating_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__rating_option`
  ADD CONSTRAINT `#__FK_RATING_OPTION_RATING_ID_RATING_RATING_ID` FOREIGN KEY (`rating_id`) REFERENCES `#__rating` (`rating_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__rating_option_vote`
  ADD CONSTRAINT `#__FK_RATING_OPTION_VOTE_OPTION_ID_RATING` FOREIGN KEY (`option_id`) REFERENCES `#__rating_option` (`option_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_RATING_OPTION_VOTE_REVIEW_ID_REVIEW` FOREIGN KEY (`review_id`) REFERENCES `#__review` (`review_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__rating_option_vote_aggregated`
  ADD CONSTRAINT `#__FK_RATING_OPTION_VOTE_AGGREGATED_RATING_ID` FOREIGN KEY (`rating_id`) REFERENCES `#__rating` (`rating_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_RATING_OPTION_VOTE_AGGREGATED_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__rating_store`
  ADD CONSTRAINT `#__FK_RATING_STORE_RATING_ID_RATING_RATING_ID` FOREIGN KEY (`rating_id`) REFERENCES `#__rating` (`rating_id`) ON DELETE CASCADE ON UPDATE NO ACTION,
  ADD CONSTRAINT `#__FK_RATING_STORE_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__rating_title`
  ADD CONSTRAINT `#__FK_RATING_TITLE_RATING_ID_RATING_RATING_ID` FOREIGN KEY (`rating_id`) REFERENCES `#__rating` (`rating_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_RATING_TITLE_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__report_compared_product_index`
  ADD CONSTRAINT `#__FK_REPORT_CMPD_PRD_IDX_CSTR_ID_CSTR_ENTT` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_REPORT_CMPD_PRD_IDX_PRD_ID_CAT_PRD_ENTT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_REPORT_COMPARED_PRODUCT_INDEX_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__report_event`
  ADD CONSTRAINT `#__FK_REPORT_EVENT_EVENT_TYPE_ID_REPORT_EVENT` FOREIGN KEY (`event_type_id`) REFERENCES `#__report_event_types` (`event_type_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_REPORT_EVENT_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__report_viewed_product_aggregated_daily`
  ADD CONSTRAINT `#__FK_REPORT_VIEWED_PRD_AGGRED_DAILY_PRD_ID_CAT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_REPORT_VIEWED_PRD_AGGRED_DAILY_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__report_viewed_product_aggregated_monthly`
  ADD CONSTRAINT `#__FK_REPORT_VIEWED_PRD_AGGRED_MONTHLY_PRD_ID` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_REPORT_VIEWED_PRD_AGGRED_MONTHLY_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__report_viewed_product_aggregated_yearly`
  ADD CONSTRAINT `#__FK_REPORT_VIEWED_PRD_AGGRED_YEARLY_PRD_ID` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_REPORT_VIEWED_PRD_AGGRED_YEARLY_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__report_viewed_product_index`
  ADD CONSTRAINT `#__FK_REPORT_VIEWED_PRD_IDX_CSTR_ID_CSTR_ENTT` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_REPORT_VIEWED_PRD_IDX_PRD_ID_CAT_PRD_ENTT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_REPORT_VIEWED_PRODUCT_INDEX_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__review`
  ADD CONSTRAINT `#__FK_REVIEW_ENTITY_ID_REVIEW_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `#__review_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_REVIEW_STATUS_ID_REVIEW_STATUS_STATUS_ID` FOREIGN KEY (`status_id`) REFERENCES `#__review_status` (`status_id`) ON DELETE NO ACTION ON UPDATE NO ACTION;
ALTER TABLE `#__review_detail`
  ADD CONSTRAINT `#__FK_REVIEW_DETAIL_CUSTOMER_ID_CUSTOMER_ENTITY` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_REVIEW_DETAIL_REVIEW_ID_REVIEW_REVIEW_ID` FOREIGN KEY (`review_id`) REFERENCES `#__review` (`review_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_REVIEW_DETAIL_STORE_ID_CORE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__review_entity_summary`
  ADD CONSTRAINT `#__FK_REVIEW_ENTITY_SUMMARY_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__review_store`
  ADD CONSTRAINT `#__FK_REVIEW_STORE_REVIEW_ID_REVIEW_REVIEW_ID` FOREIGN KEY (`review_id`) REFERENCES `#__review` (`review_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_REVIEW_STORE_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_bestsellers_aggregated_daily`
  ADD CONSTRAINT `#__FK_SALES_BESTSELLERS_AGGRED_DAILY_PRD_ID_CAT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_BESTSELLERS_AGGRED_DAILY_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_bestsellers_aggregated_monthly`
  ADD CONSTRAINT `#__FK_SALES_BESTSELLERS_AGGRED_MONTHLY_PRD_ID` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_BESTSELLERS_AGGRED_MONTHLY_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_bestsellers_aggregated_yearly`
  ADD CONSTRAINT `#__FK_SALES_BESTSELLERS_AGGRED_YEARLY_PRD_ID` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_BESTSELLERS_AGGRED_YEARLY_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_billing_agreement`
  ADD CONSTRAINT `#__FK_SALES_BILLING_AGREEMENT_CUSTOMER_ID` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_BILLING_AGREEMENT_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_billing_agreement_order`
  ADD CONSTRAINT `#__FK_SALES_BILLING_AGRT_ORDER_AGRT_ID_SALES` FOREIGN KEY (`agreement_id`) REFERENCES `#__sales_billing_agreement` (`agreement_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_BILLING_AGRT_ORDER_ORDER_ID_SALES` FOREIGN KEY (`order_id`) REFERENCES `#__sales_flat_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_creditmemo`
  ADD CONSTRAINT `#__FK_SALES_FLAT_CREDITMEMO_ORDER_ID_SALES_FLAT` FOREIGN KEY (`order_id`) REFERENCES `#__sales_flat_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_FLAT_CREDITMEMO_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_creditmemo_comment`
  ADD CONSTRAINT `#__FK_B0FCB0B5467075BE63D474F2CD5F7804` FOREIGN KEY (`parent_id`) REFERENCES `#__sales_flat_creditmemo` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_creditmemo_grid`
  ADD CONSTRAINT `#__FK_78C711B225167A11CC077B03D1C8E1CC` FOREIGN KEY (`entity_id`) REFERENCES `#__sales_flat_creditmemo` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_FLAT_CREDITMEMO_GRID_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_creditmemo_item`
  ADD CONSTRAINT `#__FK_306DAC836C699F0B5E13BE486557AC8A` FOREIGN KEY (`parent_id`) REFERENCES `#__sales_flat_creditmemo` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_invoice`
  ADD CONSTRAINT `#__FK_SALES_FLAT_INVOICE_ORDER_ID_SALES_FLAT` FOREIGN KEY (`order_id`) REFERENCES `#__sales_flat_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_FLAT_INVOICE_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_invoice_comment`
  ADD CONSTRAINT `#__FK_5C4B36BBE5231A76AB8018B281ED50BC` FOREIGN KEY (`parent_id`) REFERENCES `#__sales_flat_invoice` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_invoice_grid`
  ADD CONSTRAINT `#__FK_SALES_FLAT_INVOICE_GRID_ENTT_ID_SALES` FOREIGN KEY (`entity_id`) REFERENCES `#__sales_flat_invoice` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_FLAT_INVOICE_GRID_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_invoice_item`
  ADD CONSTRAINT `#__FK_SALES_FLAT_INVOICE_ITEM_PARENT_ID_SALES` FOREIGN KEY (`parent_id`) REFERENCES `#__sales_flat_invoice` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_order_address`
  ADD CONSTRAINT `#__FK_SALES_FLAT_ORDER_ADDRESS_PARENT_ID_SALES` FOREIGN KEY (`parent_id`) REFERENCES `#__sales_flat_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_order_grid`
  ADD CONSTRAINT `#__FK_SALES_FLAT_ORDER_GRID_CUSTOMER_ID` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_FLAT_ORDER_GRID_ENTITY_ID_SALES` FOREIGN KEY (`entity_id`) REFERENCES `#__sales_flat_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_FLAT_ORDER_GRID_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_order_item`
  ADD CONSTRAINT `#__FK_SALES_FLAT_ORDER_ITEM_ORDER_ID_SALES_FLAT` FOREIGN KEY (`order_id`) REFERENCES `#__sales_flat_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_FLAT_ORDER_ITEM_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_order_status_history`
  ADD CONSTRAINT `#__FK_CE7C71E74CB74DDACED337CEE6753D5E` FOREIGN KEY (`parent_id`) REFERENCES `#__sales_flat_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_quote_address`
  ADD CONSTRAINT `#__FK_SALES_FLAT_QUOTE_ADDRESS_QUOTE_ID_SALES` FOREIGN KEY (`quote_id`) REFERENCES `#__sales_flat_quote` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_quote_address_item`
  ADD CONSTRAINT `#__FK_2EF8E28181D666D94D4E30DC2B0F80BF` FOREIGN KEY (`quote_item_id`) REFERENCES `#__sales_flat_quote_item` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_A345FC758F20C314169CE27DCE53477F` FOREIGN KEY (`parent_item_id`) REFERENCES `#__sales_flat_quote_address_item` (`address_item_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_B521389746C00700D1B2B76EBBE53854` FOREIGN KEY (`quote_address_id`) REFERENCES `#__sales_flat_quote_address` (`address_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_quote_item`
  ADD CONSTRAINT `#__FK_B201DEB5DE51B791AF5C5BF87053C5A7` FOREIGN KEY (`parent_item_id`) REFERENCES `#__sales_flat_quote_item` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_FLAT_QUOTE_ITEM_PRD_ID_CAT_PRD_ENTT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_FLAT_QUOTE_ITEM_QUOTE_ID_SALES_FLAT` FOREIGN KEY (`quote_id`) REFERENCES `#__sales_flat_quote` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_FLAT_QUOTE_ITEM_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_quote_item_option`
  ADD CONSTRAINT `#__FK_5F20E478CA64B6891EA8A9D6C2735739` FOREIGN KEY (`item_id`) REFERENCES `#__sales_flat_quote_item` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_quote_shipping_rate`
  ADD CONSTRAINT `#__FK_B1F177EFB73D3EDF5322BA64AC48D150` FOREIGN KEY (`address_id`) REFERENCES `#__sales_flat_quote_address` (`address_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_shipment`
  ADD CONSTRAINT `#__FK_SALES_FLAT_SHIPMENT_ORDER_ID_SALES_FLAT` FOREIGN KEY (`order_id`) REFERENCES `#__sales_flat_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_FLAT_SHIPMENT_STORE_ID_CORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_shipment_comment`
  ADD CONSTRAINT `#__FK_C2D69CC1FB03D2B2B794B0439F6650CF` FOREIGN KEY (`parent_id`) REFERENCES `#__sales_flat_shipment` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_shipment_grid`
  ADD CONSTRAINT `#__FK_SALES_FLAT_SHIPMENT_GRID_ENTT_ID_SALES` FOREIGN KEY (`entity_id`) REFERENCES `#__sales_flat_shipment` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_FLAT_SHIPMENT_GRID_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_shipment_item`
  ADD CONSTRAINT `#__FK_3AECE5007D18F159231B87E8306FC02A` FOREIGN KEY (`parent_id`) REFERENCES `#__sales_flat_shipment` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_flat_shipment_track`
  ADD CONSTRAINT `#__FK_BCD2FA28717D29F37E10A153E6F2F841` FOREIGN KEY (`parent_id`) REFERENCES `#__sales_flat_shipment` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_invoiced_aggregated`
  ADD CONSTRAINT `#__FK_SALES_INVOICED_AGGREGATED_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_invoiced_aggregated_order`
  ADD CONSTRAINT `#__FK_SALES_INVOICED_AGGREGATED_ORDER_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_order_aggregated_created`
  ADD CONSTRAINT `#__FK_SALES_ORDER_AGGREGATED_CREATED_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_order_aggregated_updated`
  ADD CONSTRAINT `#__FK_SALES_ORDER_AGGREGATED_UPDATED_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_order_status_label`
  ADD CONSTRAINT `#__FK_SALES_ORDER_STATUS_LABEL_STATUS_SALES` FOREIGN KEY (`status`) REFERENCES `#__sales_order_status` (`status`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_ORDER_STATUS_LABEL_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_order_status_state`
  ADD CONSTRAINT `#__FK_SALES_ORDER_STATUS_STATE_STATUS_SALES` FOREIGN KEY (`status`) REFERENCES `#__sales_order_status` (`status`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_order_tax_item`
  ADD CONSTRAINT `#__FK_SALES_ORDER_TAX_ITEM_ITEM_ID_SALES_FLAT` FOREIGN KEY (`item_id`) REFERENCES `#__sales_flat_order_item` (`item_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_ORDER_TAX_ITEM_TAX_ID_SALES_ORDER` FOREIGN KEY (`tax_id`) REFERENCES `#__sales_order_tax` (`tax_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_payment_transaction`
  ADD CONSTRAINT `#__FK_B99FF1A06402D725EBDB0F3A7ECD47A2` FOREIGN KEY (`parent_id`) REFERENCES `#__sales_payment_transaction` (`transaction_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_DA51A10B2405B64A4DAEF77A64F0DAAD` FOREIGN KEY (`payment_id`) REFERENCES `#__sales_flat_order_payment` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_PAYMENT_TRANSACTION_ORDER_ID_SALES` FOREIGN KEY (`order_id`) REFERENCES `#__sales_flat_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_recurring_profile`
  ADD CONSTRAINT `#__FK_SALES_RECURRING_PROFILE_CUSTOMER_ID` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALES_RECURRING_PROFILE_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_recurring_profile_order`
  ADD CONSTRAINT `#__FK_7FF85741C66DCD37A4FBE3E3255A5A01` FOREIGN KEY (`order_id`) REFERENCES `#__sales_flat_order` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_B8A7A5397B67455786E55461748C59F4` FOREIGN KEY (`profile_id`) REFERENCES `#__sales_recurring_profile` (`profile_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sales_refunded_aggregated`
  ADD CONSTRAINT `#__FK_SALES_REFUNDED_AGGREGATED_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_refunded_aggregated_order`
  ADD CONSTRAINT `#__FK_SALES_REFUNDED_AGGREGATED_ORDER_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_shipping_aggregated`
  ADD CONSTRAINT `#__FK_SALES_SHIPPING_AGGREGATED_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__sales_shipping_aggregated_order`
  ADD CONSTRAINT `#__FK_SALES_SHIPPING_AGGREGATED_ORDER_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE;
ALTER TABLE `#__salesrule_coupon`
  ADD CONSTRAINT `#__FK_SALESRULE_COUPON_RULE_ID_SALESRULE_RULE` FOREIGN KEY (`rule_id`) REFERENCES `#__salesrule` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__salesrule_coupon_usage`
  ADD CONSTRAINT `#__FK_SALESRULE_COUPON_USAGE_COUPON_ID` FOREIGN KEY (`coupon_id`) REFERENCES `#__salesrule_coupon` (`coupon_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALESRULE_COUPON_USAGE_CUSTOMER_ID` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__salesrule_customer`
  ADD CONSTRAINT `#__FK_SALESRULE_CUSTOMER_CUSTOMER_ID_CUSTOMER` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALESRULE_CUSTOMER_RULE_ID_SALESRULE_RULE` FOREIGN KEY (`rule_id`) REFERENCES `#__salesrule` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__salesrule_customer_group`
  ADD CONSTRAINT `#__FK_SALESRULE_CSTR_GROUP_CSTR_GROUP_ID_CSTR` FOREIGN KEY (`customer_group_id`) REFERENCES `#__customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALESRULE_CUSTOMER_GROUP_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `#__salesrule` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__salesrule_label`
  ADD CONSTRAINT `#__FK_SALESRULE_LABEL_RULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `#__salesrule` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALESRULE_LABEL_STORE_ID_CORE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__salesrule_product_attribute`
  ADD CONSTRAINT `#__FK_SALESRULE_PRD_ATTR_ATTR_ID_EAV_ATTR_ATTR` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE NO ACTION,
  ADD CONSTRAINT `#__FK_SALESRULE_PRD_ATTR_CSTR_GROUP_ID_CSTR` FOREIGN KEY (`customer_group_id`) REFERENCES `#__customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE NO ACTION,
  ADD CONSTRAINT `#__FK_SALESRULE_PRD_ATTR_WS_ID_CORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE NO ACTION,
  ADD CONSTRAINT `#__FK_SALESRULE_PRODUCT_ATTRIBUTE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `#__salesrule` (`rule_id`) ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE `#__salesrule_website`
  ADD CONSTRAINT `#__FK_SALESRULE_WEBSITE_RULE_ID_SALESRULE_RULE` FOREIGN KEY (`rule_id`) REFERENCES `#__salesrule` (`rule_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_SALESRULE_WEBSITE_WEBSITE_ID_CORE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__sitemap`
  ADD CONSTRAINT `#__FK_SITEMAP_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__tag`
  ADD CONSTRAINT `#__FK_TAG_FIRST_CUSTOMER_ID_CUSTOMER_ENTITY` FOREIGN KEY (`first_customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE SET NULL ON UPDATE NO ACTION,
  ADD CONSTRAINT `#__FK_TAG_FIRST_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`first_store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE NO ACTION;
ALTER TABLE `#__tag_properties`
  ADD CONSTRAINT `#__FK_TAG_PROPERTIES_STORE_ID_CORE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_TAG_PROPERTIES_TAG_ID_TAG_TAG_ID` FOREIGN KEY (`tag_id`) REFERENCES `#__tag` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__tag_relation`
  ADD CONSTRAINT `#__FK_TAG_RELATION_CUSTOMER_ID_CUSTOMER_ENTITY` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_TAG_RELATION_PRODUCT_ID_CATALOG_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_TAG_RELATION_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_TAG_RELATION_TAG_ID_TAG_TAG_ID` FOREIGN KEY (`tag_id`) REFERENCES `#__tag` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__tag_summary`
  ADD CONSTRAINT `#__FK_TAG_SUMMARY_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_TAG_SUMMARY_TAG_ID_TAG_TAG_ID` FOREIGN KEY (`tag_id`) REFERENCES `#__tag` (`tag_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__tax_calculation`
  ADD CONSTRAINT `#__FK_TAX_CALCULATION_CUSTOMER_TAX_CLASS_ID_TAX` FOREIGN KEY (`customer_tax_class_id`) REFERENCES `#__tax_class` (`class_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_TAX_CALCULATION_PRODUCT_TAX_CLASS_ID_TAX` FOREIGN KEY (`product_tax_class_id`) REFERENCES `#__tax_class` (`class_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_TAX_CALC_TAX_CALC_RATE_ID_TAX_CALC_RATE` FOREIGN KEY (`tax_calculation_rate_id`) REFERENCES `#__tax_calculation_rate` (`tax_calculation_rate_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_TAX_CALC_TAX_CALC_RULE_ID_TAX_CALC_RULE` FOREIGN KEY (`tax_calculation_rule_id`) REFERENCES `#__tax_calculation_rule` (`tax_calculation_rule_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__tax_calculation_rate_title`
  ADD CONSTRAINT `#__FK_37FB965F786AD5897BB3AE90470C42AB` FOREIGN KEY (`tax_calculation_rate_id`) REFERENCES `#__tax_calculation_rate` (`tax_calculation_rate_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_TAX_CALCULATION_RATE_TITLE_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__tax_order_aggregated_created`
  ADD CONSTRAINT `#__FK_TAX_ORDER_AGGREGATED_CREATED_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__tax_order_aggregated_updated`
  ADD CONSTRAINT `#__FK_TAX_ORDER_AGGREGATED_UPDATED_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__weee_discount`
  ADD CONSTRAINT `#__FK_WEEE_DISCOUNT_CSTR_GROUP_ID_CSTR_GROUP` FOREIGN KEY (`customer_group_id`) REFERENCES `#__customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_WEEE_DISCOUNT_ENTITY_ID_CATALOG_PRODUCT` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_WEEE_DISCOUNT_WEBSITE_ID_CORE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__weee_tax`
  ADD CONSTRAINT `#__FK_WEEE_TAX_ATTRIBUTE_ID_EAV_ATTRIBUTE` FOREIGN KEY (`attribute_id`) REFERENCES `#__eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_WEEE_TAX_COUNTRY_DIRECTORY_COUNTRY` FOREIGN KEY (`country`) REFERENCES `#__directory_country` (`country_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_WEEE_TAX_ENTITY_ID_CATALOG_PRODUCT_ENTITY` FOREIGN KEY (`entity_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_WEEE_TAX_WEBSITE_ID_CORE_WEBSITE_WEBSITE` FOREIGN KEY (`website_id`) REFERENCES `#__core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__widget_instance_page`
  ADD CONSTRAINT `#__FK_WIDGET_INSTANCE_PAGE_INSTANCE_ID_WIDGET` FOREIGN KEY (`instance_id`) REFERENCES `#__widget_instance` (`instance_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__widget_instance_page_layout`
  ADD CONSTRAINT `#__FK_0A5D06DCEC6A6845F50E5FAAC5A1C96D` FOREIGN KEY (`layout_update_id`) REFERENCES `#__core_layout_update` (`layout_update_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_WIDGET_INSTANCE_PAGE_LYT_PAGE_ID_WIDGET` FOREIGN KEY (`page_id`) REFERENCES `#__widget_instance_page` (`page_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__wishlist`
  ADD CONSTRAINT `#__FK_WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY` FOREIGN KEY (`customer_id`) REFERENCES `#__customer_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__wishlist_item`
  ADD CONSTRAINT `#__FK_WISHLIST_ITEM_PRODUCT_ID_CATALOG_PRODUCT` FOREIGN KEY (`product_id`) REFERENCES `#__catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_WISHLIST_ITEM_STORE_ID_CORE_STORE_STORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE,
  ADD CONSTRAINT `#__FK_WISHLIST_ITEM_WISHLIST_ID_WISHLIST` FOREIGN KEY (`wishlist_id`) REFERENCES `#__wishlist` (`wishlist_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__wishlist_item_option`
  ADD CONSTRAINT `#__FK_A014B30B04B72DD0EAB3EECD779728D6` FOREIGN KEY (`wishlist_item_id`) REFERENCES `#__wishlist_item` (`wishlist_item_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__xmlconnect_application`
  ADD CONSTRAINT `#__FK_XMLCONNECT_APPLICATION_STORE_ID_CORE` FOREIGN KEY (`store_id`) REFERENCES `#__core_store` (`store_id`) ON DELETE SET NULL ON UPDATE SET NULL;
ALTER TABLE `#__xmlconnect_config_data`
  ADD CONSTRAINT `#__FK_31EE36D814216200D7C0723145AC510E` FOREIGN KEY (`application_id`) REFERENCES `#__xmlconnect_application` (`application_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__xmlconnect_history`
  ADD CONSTRAINT `#__FK_8F08B9513373BC19F49EE3EF8340E270` FOREIGN KEY (`application_id`) REFERENCES `#__xmlconnect_application` (`application_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__xmlconnect_images`
  ADD CONSTRAINT `#__FK_6C55A623A089E4FEA9201FFE01693167` FOREIGN KEY (`application_id`) REFERENCES `#__xmlconnect_application` (`application_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__xmlconnect_notification_template`
  ADD CONSTRAINT `#__FK_F9927C7518A907CF5C350942FD296DC3` FOREIGN KEY (`application_id`) REFERENCES `#__xmlconnect_application` (`application_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `#__xmlconnect_queue`
  ADD CONSTRAINT `#__FK_2019AEC5FC55A516965583447CA26B14` FOREIGN KEY (`template_id`) REFERENCES `#__xmlconnect_notification_template` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE;
