INSERT INTO `sgp_wishlist` (`wishlist_id`, `customer_id`, `shared`, `sharing_code`, `updated_at`) VALUES
(2052, 2061, 0, '28704eff96abedcd229469677c8ed4fc', '2020-04-03 15:20:00'),
(2053, 2062, 0, 'df9facfb0d15abd6ce6f11b6a567f138', '2020-04-03 16:25:05'),
(2054, 2063, 0, '25d90fed6d9db883e831d2acc9487776', '2020-04-03 17:26:17'),
(2055, 2064, 0, 'a031d397dd006183dfbf37aa7fa79660', '2020-04-03 18:11:18'),
(2056, 2065, 0, 'b62c5b32b2c27dc2654098e5b65bb57b', '2020-04-03 18:15:48'),
(2057, 2066, 0, '36a5d42e2c4b6134e646f712c663680e', '2020-04-03 19:01:05'),
(2058, 2067, 0, 'ecf32126f76af0c4908e7289cde2cf0b', '2020-04-03 19:43:21'),
(2059, 2068, 0, 'db24f5886bf8e80753d863bbaa2d3874', '2020-04-03 20:24:46'),
(2060, 2069, 0, '0cb3cb0e6c99031a11edf4e5813699e8', '2020-04-03 21:01:55'),
(2061, 2070, 0, '22e83c2c5604b0c6045f16c333e8a8f8', '2020-04-03 21:06:55'),
(2062, 2071, 0, 'd4c1b4df9ca5b7e5772d6a41fe0af3fd', '2020-04-03 21:46:30'),
(2063, 2072, 0, '82326149d2b327794c3d4c1fa2c6701f', '2020-04-03 22:27:54'),
(2064, 2073, 0, '432f1829b9b664dccc9a4d45a8c25775', '2020-04-03 23:10:03'),
(2065, 2074, 0, '5acc6b0fdd965542e3d82fe0ff89f597', '2020-04-03 23:55:05'),
(2066, 2075, 0, 'd3c31be1746a52f00261f1bd39e939f6', '2020-04-04 00:44:41'),
(2067, 2076, 0, 'be77741543767a92fc4e6cc4f28cf979', '2020-04-04 01:30:21'),
(2068, 2077, 0, 'e903e601335c6e05cb13c9cdc75e32ba', '2020-04-04 02:18:40'),
(2069, 2078, 0, '07bb8bcacfdd13dee5501fdabf076475', '2020-04-04 03:11:28'),
(2070, 2079, 0, '0fbf81fc9e2dc19a932d2f235cf1365d', '2020-04-04 04:07:06'),
(2071, 2080, 0, '3960f0fab7985765a7af4dbea3176993', '2020-04-04 05:02:47'),
(2072, 2081, 0, 'e3a30ce44cffd07c19fd9b1b658f6874', '2020-04-04 06:05:21'),
(2073, 2082, 0, '20430734ed52fde8382a8da92339e64a', '2020-05-20 11:42:15'),
(2074, 2084, 0, '54c9587f4219328f11343463ca94d995', '2020-06-11 05:43:15');

-- --------------------------------------------------------

--
-- Table structure for table `sgp_wishlist_item`
--

CREATE TABLE `sgp_wishlist_item` (
  `wishlist_item_id` int(10) UNSIGNED NOT NULL 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Wishlist items';

-- --------------------------------------------------------

--
-- Table structure for table `sgp_wishlist_item_option`
--

CREATE TABLE `sgp_wishlist_item_option` (
  `option_id` int(10) UNSIGNED NOT NULL 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'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Wishlist Item Option Table';

--
-- Indexes for dumped tables
--

--
-- Indexes for table `sgp_adminnotification_inbox`
--
ALTER TABLE `sgp_adminnotification_inbox`
  ADD PRIMARY KEY (`notification_id`),
  ADD KEY `SGP_ADMINNOTIFICATION_INBOX_SEVERITY` (`severity`),
  ADD KEY `SGP_ADMINNOTIFICATION_INBOX_IS_READ` (`is_read`),
  ADD KEY `SGP_ADMINNOTIFICATION_INBOX_IS_REMOVE` (`is_remove`);

--
-- Indexes for table `sgp_admin_system_messages`
--
ALTER TABLE `sgp_admin_system_messages`
  ADD PRIMARY KEY (`identity`);

--
-- Indexes for table `sgp_authorization_role`
--
ALTER TABLE `sgp_authorization_role`
  ADD PRIMARY KEY (`role_id`),
  ADD KEY `SGP_AUTHORIZATION_ROLE_PARENT_ID_SORT_ORDER` (`parent_id`,`sort_order`),
  ADD KEY `SGP_AUTHORIZATION_ROLE_TREE_LEVEL` (`tree_level`);

--
-- Indexes for table `sgp_authorization_rule`
--
ALTER TABLE `sgp_authorization_rule`
  ADD PRIMARY KEY (`rule_id`),
  ADD KEY `SGP_AUTHORIZATION_RULE_RESOURCE_ID_ROLE_ID` (`resource_id`,`role_id`),
  ADD KEY `SGP_AUTHORIZATION_RULE_ROLE_ID_RESOURCE_ID` (`role_id`,`resource_id`);

--
-- Indexes for table `sgp_cache`
--
ALTER TABLE `sgp_cache`
  ADD PRIMARY KEY (`id`),
  ADD KEY `SGP_CACHE_EXPIRE_TIME` (`expire_time`);

--
-- Indexes for table `sgp_cache_tag`
--
ALTER TABLE `sgp_cache_tag`
  ADD PRIMARY KEY (`tag`,`cache_id`),
  ADD KEY `SGP_CACHE_TAG_CACHE_ID` (`cache_id`);

--
-- Indexes for table `sgp_captcha_log`
--
ALTER TABLE `sgp_captcha_log`
  ADD PRIMARY KEY (`type`,`value`);

--
-- Indexes for table `sgp_cataloginventory_stock`
--
ALTER TABLE `sgp_cataloginventory_stock`
  ADD PRIMARY KEY (`stock_id`),
  ADD KEY `SGP_CATALOGINVENTORY_STOCK_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_cataloginventory_stock_item`
--
ALTER TABLE `sgp_cataloginventory_stock_item`
  ADD PRIMARY KEY (`item_id`),
  ADD UNIQUE KEY `SGP_CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID_WEBSITE_ID` (`product_id`,`website_id`),
  ADD KEY `SGP_CATALOGINVENTORY_STOCK_ITEM_WEBSITE_ID` (`website_id`),
  ADD KEY `SGP_CATALOGINVENTORY_STOCK_ITEM_STOCK_ID` (`stock_id`);

--
-- Indexes for table `sgp_cataloginventory_stock_status`
--
ALTER TABLE `sgp_cataloginventory_stock_status`
  ADD PRIMARY KEY (`product_id`,`website_id`,`stock_id`),
  ADD KEY `SGP_CATALOGINVENTORY_STOCK_STATUS_STOCK_ID` (`stock_id`),
  ADD KEY `SGP_CATALOGINVENTORY_STOCK_STATUS_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_cataloginventory_stock_status_idx`
--
ALTER TABLE `sgp_cataloginventory_stock_status_idx`
  ADD PRIMARY KEY (`product_id`,`website_id`,`stock_id`),
  ADD KEY `SGP_CATALOGINVENTORY_STOCK_STATUS_IDX_STOCK_ID` (`stock_id`),
  ADD KEY `SGP_CATALOGINVENTORY_STOCK_STATUS_IDX_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_cataloginventory_stock_status_tmp`
--
ALTER TABLE `sgp_cataloginventory_stock_status_tmp`
  ADD PRIMARY KEY (`product_id`,`website_id`,`stock_id`),
  ADD KEY `SGP_CATALOGINVENTORY_STOCK_STATUS_TMP_STOCK_ID` (`stock_id`),
  ADD KEY `SGP_CATALOGINVENTORY_STOCK_STATUS_TMP_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_catalogrule`
--
ALTER TABLE `sgp_catalogrule`
  ADD PRIMARY KEY (`rule_id`),
  ADD KEY `SGP_CATALOGRULE_IS_ACTIVE_SORT_ORDER_TO_DATE_FROM_DATE` (`is_active`,`sort_order`,`to_date`,`from_date`);

--
-- Indexes for table `sgp_catalogrule_customer_group`
--
ALTER TABLE `sgp_catalogrule_customer_group`
  ADD PRIMARY KEY (`rule_id`,`customer_group_id`),
  ADD KEY `SGP_CATALOGRULE_CUSTOMER_GROUP_CUSTOMER_GROUP_ID` (`customer_group_id`);

--
-- Indexes for table `sgp_catalogrule_group_website`
--
ALTER TABLE `sgp_catalogrule_group_website`
  ADD PRIMARY KEY (`rule_id`,`customer_group_id`,`website_id`),
  ADD KEY `SGP_CATALOGRULE_GROUP_WEBSITE_CUSTOMER_GROUP_ID` (`customer_group_id`),
  ADD KEY `SGP_CATALOGRULE_GROUP_WEBSITE_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_catalogrule_product`
--
ALTER TABLE `sgp_catalogrule_product`
  ADD PRIMARY KEY (`rule_product_id`),
  ADD UNIQUE KEY `IDX_FF0499210B0A828FB6F196112F6E68FB` (`rule_id`,`from_time`,`to_time`,`website_id`,`customer_group_id`,`product_id`,`sort_order`),
  ADD KEY `SGP_CATALOGRULE_PRODUCT_CUSTOMER_GROUP_ID` (`customer_group_id`),
  ADD KEY `SGP_CATALOGRULE_PRODUCT_WEBSITE_ID` (`website_id`),
  ADD KEY `SGP_CATALOGRULE_PRODUCT_FROM_TIME` (`from_time`),
  ADD KEY `SGP_CATALOGRULE_PRODUCT_TO_TIME` (`to_time`),
  ADD KEY `SGP_CATALOGRULE_PRODUCT_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_catalogrule_product_price`
--
ALTER TABLE `sgp_catalogrule_product_price`
  ADD PRIMARY KEY (`rule_product_price_id`),
  ADD UNIQUE KEY `SGP_CATRULE_PRD_PRICE_RULE_DATE_WS_ID_CSTR_GROUP_ID_PRD_ID` (`rule_date`,`website_id`,`customer_group_id`,`product_id`),
  ADD KEY `SGP_CATALOGRULE_PRODUCT_PRICE_CUSTOMER_GROUP_ID` (`customer_group_id`),
  ADD KEY `SGP_CATALOGRULE_PRODUCT_PRICE_WEBSITE_ID` (`website_id`),
  ADD KEY `SGP_CATALOGRULE_PRODUCT_PRICE_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_catalogrule_website`
--
ALTER TABLE `sgp_catalogrule_website`
  ADD PRIMARY KEY (`rule_id`,`website_id`),
  ADD KEY `SGP_CATALOGRULE_WEBSITE_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_catalogsearch_fulltext_scope1`
--
ALTER TABLE `sgp_catalogsearch_fulltext_scope1`
  ADD PRIMARY KEY (`entity_id`,`attribute_id`);
ALTER TABLE `sgp_catalogsearch_fulltext_scope1` ADD FULLTEXT KEY `FTI_FULLTEXT_DATA_INDEX` (`data_index`);

--
-- Indexes for table `sgp_catalog_category_entity`
--
ALTER TABLE `sgp_catalog_category_entity`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_LEVEL` (`level`);

--
-- Indexes for table `sgp_catalog_category_entity_datetime`
--
ALTER TABLE `sgp_catalog_category_entity_datetime`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CAT_CTGR_ENTT_DTIME_ENTT_ID_ATTR_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_DATETIME_ENTITY_ID` (`entity_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_DATETIME_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_DATETIME_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_category_entity_decimal`
--
ALTER TABLE `sgp_catalog_category_entity_decimal`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CAT_CTGR_ENTT_DEC_ENTT_ID_ATTR_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_DECIMAL_ENTITY_ID` (`entity_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_DECIMAL_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_DECIMAL_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_category_entity_int`
--
ALTER TABLE `sgp_catalog_category_entity_int`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CATALOG_CATEGORY_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_INT_ENTITY_ID` (`entity_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_INT_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_INT_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_category_entity_text`
--
ALTER TABLE `sgp_catalog_category_entity_text`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CATALOG_CATEGORY_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_TEXT_ENTITY_ID` (`entity_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_TEXT_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_TEXT_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_category_entity_varchar`
--
ALTER TABLE `sgp_catalog_category_entity_varchar`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CAT_CTGR_ENTT_VCHR_ENTT_ID_ATTR_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_VARCHAR_ENTITY_ID` (`entity_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_VARCHAR_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_category_product`
--
ALTER TABLE `sgp_catalog_category_product`
  ADD PRIMARY KEY (`entity_id`,`category_id`,`product_id`),
  ADD UNIQUE KEY `SGP_CATALOG_CATEGORY_PRODUCT_CATEGORY_ID_PRODUCT_ID` (`category_id`,`product_id`),
  ADD KEY `SGP_CATALOG_CATEGORY_PRODUCT_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_catalog_category_product_index`
--
ALTER TABLE `sgp_catalog_category_product_index`
  ADD PRIMARY KEY (`category_id`,`product_id`,`store_id`),
  ADD KEY `SGP_CAT_CTGR_PRD_IDX_PRD_ID_STORE_ID_CTGR_ID_VISIBILITY` (`product_id`,`store_id`,`category_id`,`visibility`),
  ADD KEY `IDX_51E2862799FBB22919C675486B32992E` (`store_id`,`category_id`,`visibility`,`is_parent`,`position`);

--
-- Indexes for table `sgp_catalog_category_product_index_tmp`
--
ALTER TABLE `sgp_catalog_category_product_index_tmp`
  ADD KEY `SGP_CAT_CTGR_PRD_IDX_TMP_PRD_ID_CTGR_ID_STORE_ID` (`product_id`,`category_id`,`store_id`);

--
-- Indexes for table `sgp_catalog_compare_item`
--
ALTER TABLE `sgp_catalog_compare_item`
  ADD PRIMARY KEY (`catalog_compare_item_id`),
  ADD KEY `SGP_CATALOG_COMPARE_ITEM_PRODUCT_ID` (`product_id`),
  ADD KEY `SGP_CATALOG_COMPARE_ITEM_VISITOR_ID_PRODUCT_ID` (`visitor_id`,`product_id`),
  ADD KEY `SGP_CATALOG_COMPARE_ITEM_CUSTOMER_ID_PRODUCT_ID` (`customer_id`,`product_id`),
  ADD KEY `SGP_CATALOG_COMPARE_ITEM_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_eav_attribute`
--
ALTER TABLE `sgp_catalog_eav_attribute`
  ADD PRIMARY KEY (`attribute_id`),
  ADD KEY `SGP_CATALOG_EAV_ATTRIBUTE_USED_FOR_SORT_BY` (`used_for_sort_by`),
  ADD KEY `SGP_CATALOG_EAV_ATTRIBUTE_USED_IN_PRODUCT_LISTING` (`used_in_product_listing`);

--
-- Indexes for table `sgp_catalog_product_bundle_option`
--
ALTER TABLE `sgp_catalog_product_bundle_option`
  ADD PRIMARY KEY (`option_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_BUNDLE_OPTION_PARENT_ID` (`parent_id`);

--
-- Indexes for table `sgp_catalog_product_bundle_option_value`
--
ALTER TABLE `sgp_catalog_product_bundle_option_value`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CATALOG_PRODUCT_BUNDLE_OPTION_VALUE_OPTION_ID_STORE_ID` (`option_id`,`store_id`);

--
-- Indexes for table `sgp_catalog_product_bundle_price_index`
--
ALTER TABLE `sgp_catalog_product_bundle_price_index`
  ADD PRIMARY KEY (`entity_id`,`website_id`,`customer_group_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_WEBSITE_ID` (`website_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_BUNDLE_PRICE_INDEX_CUSTOMER_GROUP_ID` (`customer_group_id`);

--
-- Indexes for table `sgp_catalog_product_bundle_selection`
--
ALTER TABLE `sgp_catalog_product_bundle_selection`
  ADD PRIMARY KEY (`selection_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_BUNDLE_SELECTION_OPTION_ID` (`option_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_BUNDLE_SELECTION_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_catalog_product_bundle_selection_price`
--
ALTER TABLE `sgp_catalog_product_bundle_selection_price`
  ADD PRIMARY KEY (`selection_id`,`website_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_BUNDLE_SELECTION_PRICE_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_catalog_product_bundle_stock_index`
--
ALTER TABLE `sgp_catalog_product_bundle_stock_index`
  ADD PRIMARY KEY (`entity_id`,`website_id`,`stock_id`,`option_id`);

--
-- Indexes for table `sgp_catalog_product_entity`
--
ALTER TABLE `sgp_catalog_product_entity`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_ATTRIBUTE_SET_ID` (`attribute_set_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_SKU` (`sku`);

--
-- Indexes for table `sgp_catalog_product_entity_datetime`
--
ALTER TABLE `sgp_catalog_product_entity_datetime`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CAT_PRD_ENTT_DTIME_ENTT_ID_ATTR_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_DATETIME_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_DATETIME_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_product_entity_decimal`
--
ALTER TABLE `sgp_catalog_product_entity_decimal`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CAT_PRD_ENTT_DEC_ENTT_ID_ATTR_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_DECIMAL_STORE_ID` (`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_DECIMAL_ATTRIBUTE_ID` (`attribute_id`);

--
-- Indexes for table `sgp_catalog_product_entity_gallery`
--
ALTER TABLE `sgp_catalog_product_entity_gallery`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CAT_PRD_ENTT_GLR_ENTT_ID_ATTR_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_GALLERY_ENTITY_ID` (`entity_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_GALLERY_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_GALLERY_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_product_entity_int`
--
ALTER TABLE `sgp_catalog_product_entity_int`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CATALOG_PRODUCT_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_INT_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_INT_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_product_entity_media_gallery`
--
ALTER TABLE `sgp_catalog_product_entity_media_gallery`
  ADD PRIMARY KEY (`value_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_MEDIA_GALLERY_ATTRIBUTE_ID` (`attribute_id`);

--
-- Indexes for table `sgp_catalog_product_entity_media_gallery_value`
--
ALTER TABLE `sgp_catalog_product_entity_media_gallery_value`
  ADD PRIMARY KEY (`record_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_MEDIA_GALLERY_VALUE_STORE_ID` (`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_MEDIA_GALLERY_VALUE_ENTITY_ID` (`entity_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_MEDIA_GALLERY_VALUE_VALUE_ID` (`value_id`);

--
-- Indexes for table `sgp_catalog_product_entity_media_gallery_value_to_entity`
--
ALTER TABLE `sgp_catalog_product_entity_media_gallery_value_to_entity`
  ADD UNIQUE KEY `SGP_CAT_PRD_ENTT_MDA_GLR_VAL_TO_ENTT_VAL_ID_ENTT_ID` (`value_id`,`entity_id`),
  ADD KEY `FK_EC24C0B66A930DEF32AE1075F4CE44F1` (`entity_id`);

--
-- Indexes for table `sgp_catalog_product_entity_media_gallery_value_video`
--
ALTER TABLE `sgp_catalog_product_entity_media_gallery_value_video`
  ADD UNIQUE KEY `SGP_CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_VAL_ID_STORE_ID` (`value_id`,`store_id`),
  ADD KEY `SGP_CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_STORE_ID_SGP_STORE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_product_entity_text`
--
ALTER TABLE `sgp_catalog_product_entity_text`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CATALOG_PRODUCT_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_TEXT_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_TEXT_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_product_entity_tier_price`
--
ALTER TABLE `sgp_catalog_product_entity_tier_price`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `UNQ_265711A12BE5CDCA8B9399006E6A5064` (`entity_id`,`all_groups`,`customer_group_id`,`qty`,`website_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_TIER_PRICE_CUSTOMER_GROUP_ID` (`customer_group_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_TIER_PRICE_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_catalog_product_entity_varchar`
--
ALTER TABLE `sgp_catalog_product_entity_varchar`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CAT_PRD_ENTT_VCHR_ENTT_ID_ATTR_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_VARCHAR_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_ENTITY_VARCHAR_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_product_index_eav`
--
ALTER TABLE `sgp_catalog_product_index_eav`
  ADD PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_STORE_ID` (`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_VALUE` (`value`);

--
-- Indexes for table `sgp_catalog_product_index_eav_decimal`
--
ALTER TABLE `sgp_catalog_product_index_eav_decimal`
  ADD PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_STORE_ID` (`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_VALUE` (`value`);

--
-- Indexes for table `sgp_catalog_product_index_eav_decimal_idx`
--
ALTER TABLE `sgp_catalog_product_index_eav_decimal_idx`
  ADD PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_IDX_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_IDX_STORE_ID` (`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_IDX_VALUE` (`value`);

--
-- Indexes for table `sgp_catalog_product_index_eav_decimal_tmp`
--
ALTER TABLE `sgp_catalog_product_index_eav_decimal_tmp`
  ADD PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_TMP_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_TMP_STORE_ID` (`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_DECIMAL_TMP_VALUE` (`value`);

--
-- Indexes for table `sgp_catalog_product_index_eav_idx`
--
ALTER TABLE `sgp_catalog_product_index_eav_idx`
  ADD PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_IDX_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_IDX_STORE_ID` (`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_IDX_VALUE` (`value`);

--
-- Indexes for table `sgp_catalog_product_index_eav_tmp`
--
ALTER TABLE `sgp_catalog_product_index_eav_tmp`
  ADD PRIMARY KEY (`entity_id`,`attribute_id`,`store_id`,`value`,`source_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_TMP_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_TMP_STORE_ID` (`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_EAV_TMP_VALUE` (`value`);

--
-- Indexes for table `sgp_catalog_product_index_price`
--
ALTER TABLE `sgp_catalog_product_index_price`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_PRICE_CUSTOMER_GROUP_ID` (`customer_group_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_PRICE_MIN_PRICE` (`min_price`),
  ADD KEY `SGP_CAT_PRD_IDX_PRICE_WS_ID_CSTR_GROUP_ID_MIN_PRICE` (`website_id`,`customer_group_id`,`min_price`);

--
-- Indexes for table `sgp_catalog_product_index_price_bundle_idx`
--
ALTER TABLE `sgp_catalog_product_index_price_bundle_idx`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_bundle_opt_idx`
--
ALTER TABLE `sgp_catalog_product_index_price_bundle_opt_idx`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`,`option_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_bundle_opt_tmp`
--
ALTER TABLE `sgp_catalog_product_index_price_bundle_opt_tmp`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`,`option_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_bundle_sel_idx`
--
ALTER TABLE `sgp_catalog_product_index_price_bundle_sel_idx`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`,`option_id`,`selection_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_bundle_sel_tmp`
--
ALTER TABLE `sgp_catalog_product_index_price_bundle_sel_tmp`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`,`option_id`,`selection_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_bundle_tmp`
--
ALTER TABLE `sgp_catalog_product_index_price_bundle_tmp`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_cfg_opt_agr_idx`
--
ALTER TABLE `sgp_catalog_product_index_price_cfg_opt_agr_idx`
  ADD PRIMARY KEY (`parent_id`,`child_id`,`customer_group_id`,`website_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_cfg_opt_agr_tmp`
--
ALTER TABLE `sgp_catalog_product_index_price_cfg_opt_agr_tmp`
  ADD PRIMARY KEY (`parent_id`,`child_id`,`customer_group_id`,`website_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_cfg_opt_idx`
--
ALTER TABLE `sgp_catalog_product_index_price_cfg_opt_idx`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_cfg_opt_tmp`
--
ALTER TABLE `sgp_catalog_product_index_price_cfg_opt_tmp`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_downlod_idx`
--
ALTER TABLE `sgp_catalog_product_index_price_downlod_idx`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_downlod_tmp`
--
ALTER TABLE `sgp_catalog_product_index_price_downlod_tmp`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_final_idx`
--
ALTER TABLE `sgp_catalog_product_index_price_final_idx`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_final_tmp`
--
ALTER TABLE `sgp_catalog_product_index_price_final_tmp`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_idx`
--
ALTER TABLE `sgp_catalog_product_index_price_idx`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_PRICE_IDX_CUSTOMER_GROUP_ID` (`customer_group_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_PRICE_IDX_WEBSITE_ID` (`website_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_PRICE_IDX_MIN_PRICE` (`min_price`);

--
-- Indexes for table `sgp_catalog_product_index_price_opt_agr_idx`
--
ALTER TABLE `sgp_catalog_product_index_price_opt_agr_idx`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`,`option_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_opt_agr_tmp`
--
ALTER TABLE `sgp_catalog_product_index_price_opt_agr_tmp`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`,`option_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_opt_idx`
--
ALTER TABLE `sgp_catalog_product_index_price_opt_idx`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_opt_tmp`
--
ALTER TABLE `sgp_catalog_product_index_price_opt_tmp`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`);

--
-- Indexes for table `sgp_catalog_product_index_price_tmp`
--
ALTER TABLE `sgp_catalog_product_index_price_tmp`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_PRICE_TMP_CUSTOMER_GROUP_ID` (`customer_group_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_PRICE_TMP_WEBSITE_ID` (`website_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_PRICE_TMP_MIN_PRICE` (`min_price`);

--
-- Indexes for table `sgp_catalog_product_index_tier_price`
--
ALTER TABLE `sgp_catalog_product_index_tier_price`
  ADD PRIMARY KEY (`entity_id`,`customer_group_id`,`website_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_TIER_PRICE_CUSTOMER_GROUP_ID` (`customer_group_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_TIER_PRICE_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_catalog_product_index_website`
--
ALTER TABLE `sgp_catalog_product_index_website`
  ADD PRIMARY KEY (`website_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_INDEX_WEBSITE_WEBSITE_DATE` (`website_date`);

--
-- Indexes for table `sgp_catalog_product_link`
--
ALTER TABLE `sgp_catalog_product_link`
  ADD PRIMARY KEY (`link_id`),
  ADD UNIQUE KEY `SGP_CAT_PRD_LNK_LNK_TYPE_ID_PRD_ID_LNKED_PRD_ID` (`link_type_id`,`product_id`,`linked_product_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_LINK_PRODUCT_ID` (`product_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_LINK_LINKED_PRODUCT_ID` (`linked_product_id`);

--
-- Indexes for table `sgp_catalog_product_link_attribute`
--
ALTER TABLE `sgp_catalog_product_link_attribute`
  ADD PRIMARY KEY (`product_link_attribute_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_LINK_ATTRIBUTE_LINK_TYPE_ID` (`link_type_id`);

--
-- Indexes for table `sgp_catalog_product_link_attribute_decimal`
--
ALTER TABLE `sgp_catalog_product_link_attribute_decimal`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CAT_PRD_LNK_ATTR_DEC_PRD_LNK_ATTR_ID_LNK_ID` (`product_link_attribute_id`,`link_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_LINK_ATTRIBUTE_DECIMAL_LINK_ID` (`link_id`);

--
-- Indexes for table `sgp_catalog_product_link_attribute_int`
--
ALTER TABLE `sgp_catalog_product_link_attribute_int`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CAT_PRD_LNK_ATTR_INT_PRD_LNK_ATTR_ID_LNK_ID` (`product_link_attribute_id`,`link_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_LINK_ATTRIBUTE_INT_LINK_ID` (`link_id`);

--
-- Indexes for table `sgp_catalog_product_link_attribute_varchar`
--
ALTER TABLE `sgp_catalog_product_link_attribute_varchar`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CAT_PRD_LNK_ATTR_VCHR_PRD_LNK_ATTR_ID_LNK_ID` (`product_link_attribute_id`,`link_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_LINK_ATTRIBUTE_VARCHAR_LINK_ID` (`link_id`);

--
-- Indexes for table `sgp_catalog_product_link_type`
--
ALTER TABLE `sgp_catalog_product_link_type`
  ADD PRIMARY KEY (`link_type_id`);

--
-- Indexes for table `sgp_catalog_product_option`
--
ALTER TABLE `sgp_catalog_product_option`
  ADD PRIMARY KEY (`option_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_OPTION_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_catalog_product_option_price`
--
ALTER TABLE `sgp_catalog_product_option_price`
  ADD PRIMARY KEY (`option_price_id`),
  ADD UNIQUE KEY `SGP_CATALOG_PRODUCT_OPTION_PRICE_OPTION_ID_STORE_ID` (`option_id`,`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_OPTION_PRICE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_product_option_title`
--
ALTER TABLE `sgp_catalog_product_option_title`
  ADD PRIMARY KEY (`option_title_id`),
  ADD UNIQUE KEY `SGP_CATALOG_PRODUCT_OPTION_TITLE_OPTION_ID_STORE_ID` (`option_id`,`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_OPTION_TITLE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_product_option_type_price`
--
ALTER TABLE `sgp_catalog_product_option_type_price`
  ADD PRIMARY KEY (`option_type_price_id`),
  ADD UNIQUE KEY `SGP_CATALOG_PRODUCT_OPTION_TYPE_PRICE_OPTION_TYPE_ID_STORE_ID` (`option_type_id`,`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_OPTION_TYPE_PRICE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_product_option_type_title`
--
ALTER TABLE `sgp_catalog_product_option_type_title`
  ADD PRIMARY KEY (`option_type_title_id`),
  ADD UNIQUE KEY `SGP_CATALOG_PRODUCT_OPTION_TYPE_TITLE_OPTION_TYPE_ID_STORE_ID` (`option_type_id`,`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_OPTION_TYPE_TITLE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_product_option_type_value`
--
ALTER TABLE `sgp_catalog_product_option_type_value`
  ADD PRIMARY KEY (`option_type_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_OPTION_TYPE_VALUE_OPTION_ID` (`option_id`);

--
-- Indexes for table `sgp_catalog_product_relation`
--
ALTER TABLE `sgp_catalog_product_relation`
  ADD PRIMARY KEY (`parent_id`,`child_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_RELATION_CHILD_ID` (`child_id`);

--
-- Indexes for table `sgp_catalog_product_super_attribute`
--
ALTER TABLE `sgp_catalog_product_super_attribute`
  ADD PRIMARY KEY (`product_super_attribute_id`),
  ADD UNIQUE KEY `SGP_CATALOG_PRODUCT_SUPER_ATTRIBUTE_PRODUCT_ID_ATTRIBUTE_ID` (`product_id`,`attribute_id`);

--
-- Indexes for table `sgp_catalog_product_super_attribute_label`
--
ALTER TABLE `sgp_catalog_product_super_attribute_label`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CAT_PRD_SPR_ATTR_LBL_PRD_SPR_ATTR_ID_STORE_ID` (`product_super_attribute_id`,`store_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_SUPER_ATTRIBUTE_LABEL_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_catalog_product_super_link`
--
ALTER TABLE `sgp_catalog_product_super_link`
  ADD PRIMARY KEY (`link_id`),
  ADD UNIQUE KEY `SGP_CATALOG_PRODUCT_SUPER_LINK_PRODUCT_ID_PARENT_ID` (`product_id`,`parent_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_SUPER_LINK_PARENT_ID` (`parent_id`);

--
-- Indexes for table `sgp_catalog_product_website`
--
ALTER TABLE `sgp_catalog_product_website`
  ADD PRIMARY KEY (`product_id`,`website_id`),
  ADD KEY `SGP_CATALOG_PRODUCT_WEBSITE_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_catalog_url_rewrite_product_category`
--
ALTER TABLE `sgp_catalog_url_rewrite_product_category`
  ADD KEY `SGP_CATALOG_URL_REWRITE_PRODUCT_CATEGORY_CATEGORY_ID_PRODUCT_ID` (`category_id`,`product_id`),
  ADD KEY `SGP_CAT_URL_REWRITE_PRD_CTGR_PRD_ID_CAT_PRD_ENTT_ENTT_ID` (`product_id`),
  ADD KEY `FK_2EF4E10A8E5E7AB707FF0ADE208F4CB0` (`url_rewrite_id`);

--
-- Indexes for table `sgp_checkout_agreement`
--
ALTER TABLE `sgp_checkout_agreement`
  ADD PRIMARY KEY (`agreement_id`);

--
-- Indexes for table `sgp_checkout_agreement_store`
--
ALTER TABLE `sgp_checkout_agreement_store`
  ADD PRIMARY KEY (`agreement_id`,`store_id`),
  ADD KEY `SGP_CHECKOUT_AGREEMENT_STORE_STORE_ID_STORE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_cms_block`
--
ALTER TABLE `sgp_cms_block`
  ADD PRIMARY KEY (`block_id`);
ALTER TABLE `sgp_cms_block` ADD FULLTEXT KEY `SGP_CMS_BLOCK_TITLE_IDENTIFIER_CONTENT` (`title`,`identifier`,`content`);

--
-- Indexes for table `sgp_cms_block_store`
--
ALTER TABLE `sgp_cms_block_store`
  ADD PRIMARY KEY (`block_id`,`store_id`),
  ADD KEY `SGP_CMS_BLOCK_STORE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_cms_page`
--
ALTER TABLE `sgp_cms_page`
  ADD PRIMARY KEY (`page_id`),
  ADD KEY `SGP_CMS_PAGE_IDENTIFIER` (`identifier`);
ALTER TABLE `sgp_cms_page` ADD FULLTEXT KEY `FTI_776C19A388BE069EF9036E059849C26D` (`title`,`meta_keywords`,`meta_description`,`identifier`,`content`);

--
-- Indexes for table `sgp_cms_page_store`
--
ALTER TABLE `sgp_cms_page_store`
  ADD PRIMARY KEY (`page_id`,`store_id`),
  ADD KEY `SGP_CMS_PAGE_STORE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_core_config_data`
--
ALTER TABLE `sgp_core_config_data`
  ADD PRIMARY KEY (`config_id`),
  ADD UNIQUE KEY `SGP_CORE_CONFIG_DATA_SCOPE_SCOPE_ID_PATH` (`scope`,`scope_id`,`path`);

--
-- Indexes for table `sgp_cron_schedule`
--
ALTER TABLE `sgp_cron_schedule`
  ADD PRIMARY KEY (`schedule_id`),
  ADD KEY `SGP_CRON_SCHEDULE_JOB_CODE` (`job_code`),
  ADD KEY `SGP_CRON_SCHEDULE_SCHEDULED_AT_STATUS` (`scheduled_at`,`status`);

--
-- Indexes for table `sgp_customer_address_entity`
--
ALTER TABLE `sgp_customer_address_entity`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_CUSTOMER_ADDRESS_ENTITY_PARENT_ID` (`parent_id`);

--
-- Indexes for table `sgp_customer_address_entity_datetime`
--
ALTER TABLE `sgp_customer_address_entity_datetime`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CUSTOMER_ADDRESS_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID` (`entity_id`,`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ADDRESS_ENTITY_DATETIME_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CSTR_ADDR_ENTT_DTIME_ENTT_ID_ATTR_ID_VAL` (`entity_id`,`attribute_id`,`value`);

--
-- Indexes for table `sgp_customer_address_entity_decimal`
--
ALTER TABLE `sgp_customer_address_entity_decimal`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CUSTOMER_ADDRESS_ENTITY_DECIMAL_ENTITY_ID_ATTRIBUTE_ID` (`entity_id`,`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ADDRESS_ENTITY_DECIMAL_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ADDRESS_ENTITY_DECIMAL_ENTITY_ID_ATTRIBUTE_ID_VALUE` (`entity_id`,`attribute_id`,`value`);

--
-- Indexes for table `sgp_customer_address_entity_int`
--
ALTER TABLE `sgp_customer_address_entity_int`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CUSTOMER_ADDRESS_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID` (`entity_id`,`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ADDRESS_ENTITY_INT_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ADDRESS_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_VALUE` (`entity_id`,`attribute_id`,`value`);

--
-- Indexes for table `sgp_customer_address_entity_text`
--
ALTER TABLE `sgp_customer_address_entity_text`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CUSTOMER_ADDRESS_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID` (`entity_id`,`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ADDRESS_ENTITY_TEXT_ATTRIBUTE_ID` (`attribute_id`);

--
-- Indexes for table `sgp_customer_address_entity_varchar`
--
ALTER TABLE `sgp_customer_address_entity_varchar`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CUSTOMER_ADDRESS_ENTITY_VARCHAR_ENTITY_ID_ATTRIBUTE_ID` (`entity_id`,`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ADDRESS_ENTITY_VARCHAR_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ADDRESS_ENTITY_VARCHAR_ENTITY_ID_ATTRIBUTE_ID_VALUE` (`entity_id`,`attribute_id`,`value`);

--
-- Indexes for table `sgp_customer_eav_attribute`
--
ALTER TABLE `sgp_customer_eav_attribute`
  ADD PRIMARY KEY (`attribute_id`);

--
-- Indexes for table `sgp_customer_eav_attribute_website`
--
ALTER TABLE `sgp_customer_eav_attribute_website`
  ADD PRIMARY KEY (`attribute_id`,`website_id`),
  ADD KEY `SGP_CUSTOMER_EAV_ATTRIBUTE_WEBSITE_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_customer_entity_datetime`
--
ALTER TABLE `sgp_customer_entity_datetime`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CUSTOMER_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID` (`entity_id`,`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ENTITY_DATETIME_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID_VALUE` (`entity_id`,`attribute_id`,`value`);

--
-- Indexes for table `sgp_customer_entity_decimal`
--
ALTER TABLE `sgp_customer_entity_decimal`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CUSTOMER_ENTITY_DECIMAL_ENTITY_ID_ATTRIBUTE_ID` (`entity_id`,`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ENTITY_DECIMAL_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ENTITY_DECIMAL_ENTITY_ID_ATTRIBUTE_ID_VALUE` (`entity_id`,`attribute_id`,`value`);

--
-- Indexes for table `sgp_customer_entity_int`
--
ALTER TABLE `sgp_customer_entity_int`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CUSTOMER_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID` (`entity_id`,`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ENTITY_INT_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_VALUE` (`entity_id`,`attribute_id`,`value`);

--
-- Indexes for table `sgp_customer_entity_text`
--
ALTER TABLE `sgp_customer_entity_text`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CUSTOMER_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID` (`entity_id`,`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ENTITY_TEXT_ATTRIBUTE_ID` (`attribute_id`);

--
-- Indexes for table `sgp_customer_entity_varchar`
--
ALTER TABLE `sgp_customer_entity_varchar`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_CUSTOMER_ENTITY_VARCHAR_ENTITY_ID_ATTRIBUTE_ID` (`entity_id`,`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ENTITY_VARCHAR_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_CUSTOMER_ENTITY_VARCHAR_ENTITY_ID_ATTRIBUTE_ID_VALUE` (`entity_id`,`attribute_id`,`value`);

--
-- Indexes for table `sgp_customer_form_attribute`
--
ALTER TABLE `sgp_customer_form_attribute`
  ADD PRIMARY KEY (`form_code`,`attribute_id`),
  ADD KEY `SGP_CUSTOMER_FORM_ATTRIBUTE_ATTRIBUTE_ID` (`attribute_id`);

--
-- Indexes for table `sgp_customer_grid_flat`
--
ALTER TABLE `sgp_customer_grid_flat`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_CUSTOMER_GRID_FLAT_GROUP_ID` (`group_id`),
  ADD KEY `SGP_CUSTOMER_GRID_FLAT_CREATED_AT` (`created_at`),
  ADD KEY `SGP_CUSTOMER_GRID_FLAT_WEBSITE_ID` (`website_id`),
  ADD KEY `SGP_CUSTOMER_GRID_FLAT_CONFIRMATION` (`confirmation`),
  ADD KEY `SGP_CUSTOMER_GRID_FLAT_DOB` (`dob`),
  ADD KEY `SGP_CUSTOMER_GRID_FLAT_GENDER` (`gender`),
  ADD KEY `SGP_CUSTOMER_GRID_FLAT_BILLING_COUNTRY_ID` (`billing_country_id`);
ALTER TABLE `sgp_customer_grid_flat` ADD FULLTEXT KEY `FTI_5A7CE5D2464D87CD98A1086F16CBBAC1` (`name`,`email`,`created_in`,`taxvat`,`shipping_full`,`billing_full`,`billing_firstname`,`billing_lastname`,`billing_telephone`,`billing_postcode`,`billing_region`,`billing_city`,`billing_fax`,`billing_company`);

--
-- Indexes for table `sgp_customer_group`
--
ALTER TABLE `sgp_customer_group`
  ADD PRIMARY KEY (`customer_group_id`);

--
-- Indexes for table `sgp_customer_log`
--
ALTER TABLE `sgp_customer_log`
  ADD PRIMARY KEY (`log_id`),
  ADD UNIQUE KEY `SGP_CUSTOMER_LOG_CUSTOMER_ID` (`customer_id`);

--
-- Indexes for table `sgp_customer_visitor`
--
ALTER TABLE `sgp_customer_visitor`
  ADD PRIMARY KEY (`visitor_id`),
  ADD KEY `SGP_CUSTOMER_VISITOR_CUSTOMER_ID` (`customer_id`),
  ADD KEY `SGP_CUSTOMER_VISITOR_LAST_VISIT_AT` (`last_visit_at`);

--
-- Indexes for table `sgp_design_change`
--
ALTER TABLE `sgp_design_change`
  ADD PRIMARY KEY (`design_change_id`),
  ADD KEY `SGP_DESIGN_CHANGE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_design_config_grid_flat`
--
ALTER TABLE `sgp_design_config_grid_flat`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_DESIGN_CONFIG_GRID_FLAT_STORE_WEBSITE_ID` (`store_website_id`),
  ADD KEY `SGP_DESIGN_CONFIG_GRID_FLAT_STORE_GROUP_ID` (`store_group_id`),
  ADD KEY `SGP_DESIGN_CONFIG_GRID_FLAT_STORE_ID` (`store_id`);
ALTER TABLE `sgp_design_config_grid_flat` ADD FULLTEXT KEY `SGP_DESIGN_CONFIG_GRID_FLAT_THEME_THEME_ID` (`theme_theme_id`);

--
-- Indexes for table `sgp_directory_country`
--
ALTER TABLE `sgp_directory_country`
  ADD PRIMARY KEY (`country_id`);

--
-- Indexes for table `sgp_directory_country_format`
--
ALTER TABLE `sgp_directory_country_format`
  ADD PRIMARY KEY (`country_format_id`),
  ADD UNIQUE KEY `SGP_DIRECTORY_COUNTRY_FORMAT_COUNTRY_ID_TYPE` (`country_id`,`type`);

--
-- Indexes for table `sgp_directory_country_region`
--
ALTER TABLE `sgp_directory_country_region`
  ADD PRIMARY KEY (`region_id`),
  ADD KEY `SGP_DIRECTORY_COUNTRY_REGION_COUNTRY_ID` (`country_id`);

--
-- Indexes for table `sgp_directory_country_region_name`
--
ALTER TABLE `sgp_directory_country_region_name`
  ADD PRIMARY KEY (`locale`,`region_id`),
  ADD KEY `SGP_DIRECTORY_COUNTRY_REGION_NAME_REGION_ID` (`region_id`);

--
-- Indexes for table `sgp_directory_currency_rate`
--
ALTER TABLE `sgp_directory_currency_rate`
  ADD PRIMARY KEY (`currency_from`,`currency_to`),
  ADD KEY `SGP_DIRECTORY_CURRENCY_RATE_CURRENCY_TO` (`currency_to`);

--
-- Indexes for table `sgp_downloadable_link`
--
ALTER TABLE `sgp_downloadable_link`
  ADD PRIMARY KEY (`link_id`),
  ADD KEY `SGP_DOWNLOADABLE_LINK_PRODUCT_ID_SORT_ORDER` (`product_id`,`sort_order`);

--
-- Indexes for table `sgp_downloadable_link_price`
--
ALTER TABLE `sgp_downloadable_link_price`
  ADD PRIMARY KEY (`price_id`),
  ADD KEY `SGP_DOWNLOADABLE_LINK_PRICE_LINK_ID` (`link_id`),
  ADD KEY `SGP_DOWNLOADABLE_LINK_PRICE_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_downloadable_link_purchased`
--
ALTER TABLE `sgp_downloadable_link_purchased`
  ADD PRIMARY KEY (`purchased_id`),
  ADD KEY `SGP_DOWNLOADABLE_LINK_PURCHASED_ORDER_ID` (`order_id`),
  ADD KEY `SGP_DOWNLOADABLE_LINK_PURCHASED_ORDER_ITEM_ID` (`order_item_id`),
  ADD KEY `SGP_DOWNLOADABLE_LINK_PURCHASED_CUSTOMER_ID` (`customer_id`);

--
-- Indexes for table `sgp_downloadable_link_purchased_item`
--
ALTER TABLE `sgp_downloadable_link_purchased_item`
  ADD PRIMARY KEY (`item_id`),
  ADD KEY `SGP_DOWNLOADABLE_LINK_PURCHASED_ITEM_LINK_HASH` (`link_hash`),
  ADD KEY `SGP_DOWNLOADABLE_LINK_PURCHASED_ITEM_ORDER_ITEM_ID` (`order_item_id`),
  ADD KEY `SGP_DOWNLOADABLE_LINK_PURCHASED_ITEM_PURCHASED_ID` (`purchased_id`);

--
-- Indexes for table `sgp_downloadable_link_title`
--
ALTER TABLE `sgp_downloadable_link_title`
  ADD PRIMARY KEY (`title_id`),
  ADD UNIQUE KEY `SGP_DOWNLOADABLE_LINK_TITLE_LINK_ID_STORE_ID` (`link_id`,`store_id`),
  ADD KEY `SGP_DOWNLOADABLE_LINK_TITLE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_downloadable_sample`
--
ALTER TABLE `sgp_downloadable_sample`
  ADD PRIMARY KEY (`sample_id`),
  ADD KEY `SGP_DOWNLOADABLE_SAMPLE_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_downloadable_sample_title`
--
ALTER TABLE `sgp_downloadable_sample_title`
  ADD PRIMARY KEY (`title_id`),
  ADD UNIQUE KEY `SGP_DOWNLOADABLE_SAMPLE_TITLE_SAMPLE_ID_STORE_ID` (`sample_id`,`store_id`),
  ADD KEY `SGP_DOWNLOADABLE_SAMPLE_TITLE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_eav_attribute`
--
ALTER TABLE `sgp_eav_attribute`
  ADD PRIMARY KEY (`attribute_id`),
  ADD UNIQUE KEY `SGP_EAV_ATTRIBUTE_ENTITY_TYPE_ID_ATTRIBUTE_CODE` (`entity_type_id`,`attribute_code`);

--
-- Indexes for table `sgp_eav_attribute_group`
--
ALTER TABLE `sgp_eav_attribute_group`
  ADD PRIMARY KEY (`attribute_group_id`),
  ADD UNIQUE KEY `SGP_EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_ATTRIBUTE_GROUP_NAME` (`attribute_set_id`,`attribute_group_name`),
  ADD KEY `SGP_EAV_ATTRIBUTE_GROUP_ATTRIBUTE_SET_ID_SORT_ORDER` (`attribute_set_id`,`sort_order`);

--
-- Indexes for table `sgp_eav_attribute_label`
--
ALTER TABLE `sgp_eav_attribute_label`
  ADD PRIMARY KEY (`attribute_label_id`),
  ADD KEY `SGP_EAV_ATTRIBUTE_LABEL_STORE_ID` (`store_id`),
  ADD KEY `SGP_EAV_ATTRIBUTE_LABEL_ATTRIBUTE_ID_STORE_ID` (`attribute_id`,`store_id`);

--
-- Indexes for table `sgp_eav_attribute_option`
--
ALTER TABLE `sgp_eav_attribute_option`
  ADD PRIMARY KEY (`option_id`),
  ADD KEY `SGP_EAV_ATTRIBUTE_OPTION_ATTRIBUTE_ID` (`attribute_id`);

--
-- Indexes for table `sgp_eav_attribute_option_swatch`
--
ALTER TABLE `sgp_eav_attribute_option_swatch`
  ADD PRIMARY KEY (`swatch_id`),
  ADD UNIQUE KEY `SGP_EAV_ATTRIBUTE_OPTION_SWATCH_STORE_ID_OPTION_ID` (`store_id`,`option_id`),
  ADD KEY `SGP_EAV_ATTRIBUTE_OPTION_SWATCH_SWATCH_ID` (`swatch_id`),
  ADD KEY `SGP_EAV_ATTR_OPT_SWATCH_OPT_ID_EAV_ATTR_OPT_OPT_ID` (`option_id`);

--
-- Indexes for table `sgp_eav_attribute_option_value`
--
ALTER TABLE `sgp_eav_attribute_option_value`
  ADD PRIMARY KEY (`value_id`),
  ADD KEY `SGP_EAV_ATTRIBUTE_OPTION_VALUE_OPTION_ID` (`option_id`),
  ADD KEY `SGP_EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_eav_attribute_set`
--
ALTER TABLE `sgp_eav_attribute_set`
  ADD PRIMARY KEY (`attribute_set_id`),
  ADD UNIQUE KEY `SGP_EAV_ATTRIBUTE_SET_ENTITY_TYPE_ID_ATTRIBUTE_SET_NAME` (`entity_type_id`,`attribute_set_name`),
  ADD KEY `SGP_EAV_ATTRIBUTE_SET_ENTITY_TYPE_ID_SORT_ORDER` (`entity_type_id`,`sort_order`);

--
-- Indexes for table `sgp_eav_entity`
--
ALTER TABLE `sgp_eav_entity`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_EAV_ENTITY_ENTITY_TYPE_ID` (`entity_type_id`),
  ADD KEY `SGP_EAV_ENTITY_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_eav_entity_attribute`
--
ALTER TABLE `sgp_eav_entity_attribute`
  ADD PRIMARY KEY (`entity_attribute_id`),
  ADD UNIQUE KEY `SGP_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_SET_ID_ATTRIBUTE_ID` (`attribute_set_id`,`attribute_id`),
  ADD UNIQUE KEY `SGP_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_GROUP_ID_ATTRIBUTE_ID` (`attribute_group_id`,`attribute_id`),
  ADD KEY `SGP_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_SET_ID_SORT_ORDER` (`attribute_set_id`,`sort_order`),
  ADD KEY `SGP_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_ID` (`attribute_id`);

--
-- Indexes for table `sgp_eav_entity_datetime`
--
ALTER TABLE `sgp_eav_entity_datetime`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_EAV_ENTITY_DATETIME_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_EAV_ENTITY_DATETIME_STORE_ID` (`store_id`),
  ADD KEY `SGP_EAV_ENTITY_DATETIME_ATTRIBUTE_ID_VALUE` (`attribute_id`,`value`),
  ADD KEY `SGP_EAV_ENTITY_DATETIME_ENTITY_TYPE_ID_VALUE` (`entity_type_id`,`value`);

--
-- Indexes for table `sgp_eav_entity_decimal`
--
ALTER TABLE `sgp_eav_entity_decimal`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_EAV_ENTITY_DECIMAL_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_EAV_ENTITY_DECIMAL_STORE_ID` (`store_id`),
  ADD KEY `SGP_EAV_ENTITY_DECIMAL_ATTRIBUTE_ID_VALUE` (`attribute_id`,`value`),
  ADD KEY `SGP_EAV_ENTITY_DECIMAL_ENTITY_TYPE_ID_VALUE` (`entity_type_id`,`value`);

--
-- Indexes for table `sgp_eav_entity_int`
--
ALTER TABLE `sgp_eav_entity_int`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_EAV_ENTITY_INT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_EAV_ENTITY_INT_STORE_ID` (`store_id`),
  ADD KEY `SGP_EAV_ENTITY_INT_ATTRIBUTE_ID_VALUE` (`attribute_id`,`value`),
  ADD KEY `SGP_EAV_ENTITY_INT_ENTITY_TYPE_ID_VALUE` (`entity_type_id`,`value`);

--
-- Indexes for table `sgp_eav_entity_store`
--
ALTER TABLE `sgp_eav_entity_store`
  ADD PRIMARY KEY (`entity_store_id`),
  ADD KEY `SGP_EAV_ENTITY_STORE_ENTITY_TYPE_ID` (`entity_type_id`),
  ADD KEY `SGP_EAV_ENTITY_STORE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_eav_entity_text`
--
ALTER TABLE `sgp_eav_entity_text`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_EAV_ENTITY_TEXT_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_EAV_ENTITY_TEXT_ENTITY_TYPE_ID` (`entity_type_id`),
  ADD KEY `SGP_EAV_ENTITY_TEXT_ATTRIBUTE_ID` (`attribute_id`),
  ADD KEY `SGP_EAV_ENTITY_TEXT_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_eav_entity_type`
--
ALTER TABLE `sgp_eav_entity_type`
  ADD PRIMARY KEY (`entity_type_id`),
  ADD KEY `SGP_EAV_ENTITY_TYPE_ENTITY_TYPE_CODE` (`entity_type_code`);

--
-- Indexes for table `sgp_eav_entity_varchar`
--
ALTER TABLE `sgp_eav_entity_varchar`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_EAV_ENTITY_VARCHAR_ENTITY_ID_ATTRIBUTE_ID_STORE_ID` (`entity_id`,`attribute_id`,`store_id`),
  ADD KEY `SGP_EAV_ENTITY_VARCHAR_STORE_ID` (`store_id`),
  ADD KEY `SGP_EAV_ENTITY_VARCHAR_ATTRIBUTE_ID_VALUE` (`attribute_id`,`value`),
  ADD KEY `SGP_EAV_ENTITY_VARCHAR_ENTITY_TYPE_ID_VALUE` (`entity_type_id`,`value`);

--
-- Indexes for table `sgp_eav_form_element`
--
ALTER TABLE `sgp_eav_form_element`
  ADD PRIMARY KEY (`element_id`),
  ADD UNIQUE KEY `SGP_EAV_FORM_ELEMENT_TYPE_ID_ATTRIBUTE_ID` (`type_id`,`attribute_id`),
  ADD KEY `SGP_EAV_FORM_ELEMENT_FIELDSET_ID` (`fieldset_id`),
  ADD KEY `SGP_EAV_FORM_ELEMENT_ATTRIBUTE_ID` (`attribute_id`);

--
-- Indexes for table `sgp_eav_form_fieldset`
--
ALTER TABLE `sgp_eav_form_fieldset`
  ADD PRIMARY KEY (`fieldset_id`),
  ADD UNIQUE KEY `SGP_EAV_FORM_FIELDSET_TYPE_ID_CODE` (`type_id`,`code`);

--
-- Indexes for table `sgp_eav_form_fieldset_label`
--
ALTER TABLE `sgp_eav_form_fieldset_label`
  ADD PRIMARY KEY (`fieldset_id`,`store_id`),
  ADD KEY `SGP_EAV_FORM_FIELDSET_LABEL_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_eav_form_type`
--
ALTER TABLE `sgp_eav_form_type`
  ADD PRIMARY KEY (`type_id`),
  ADD UNIQUE KEY `SGP_EAV_FORM_TYPE_CODE_THEME_STORE_ID` (`code`,`theme`,`store_id`),
  ADD KEY `SGP_EAV_FORM_TYPE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_eav_form_type_entity`
--
ALTER TABLE `sgp_eav_form_type_entity`
  ADD PRIMARY KEY (`type_id`,`entity_type_id`),
  ADD KEY `SGP_EAV_FORM_TYPE_ENTITY_ENTITY_TYPE_ID` (`entity_type_id`);

--
-- Indexes for table `sgp_email_template`
--
ALTER TABLE `sgp_email_template`
  ADD PRIMARY KEY (`template_id`),
  ADD UNIQUE KEY `SGP_EMAIL_TEMPLATE_TEMPLATE_CODE` (`template_code`),
  ADD KEY `SGP_EMAIL_TEMPLATE_ADDED_AT` (`added_at`),
  ADD KEY `SGP_EMAIL_TEMPLATE_MODIFIED_AT` (`modified_at`);

--
-- Indexes for table `sgp_flag`
--
ALTER TABLE `sgp_flag`
  ADD PRIMARY KEY (`flag_id`),
  ADD KEY `SGP_FLAG_LAST_UPDATE` (`last_update`);

--
-- Indexes for table `sgp_gift_message`
--
ALTER TABLE `sgp_gift_message`
  ADD PRIMARY KEY (`gift_message_id`);

--
-- Indexes for table `sgp_googleoptimizer_code`
--
ALTER TABLE `sgp_googleoptimizer_code`
  ADD PRIMARY KEY (`code_id`),
  ADD UNIQUE KEY `SGP_GOOGLEOPTIMIZER_CODE_STORE_ID_ENTITY_ID_ENTITY_TYPE` (`store_id`,`entity_id`,`entity_type`);

--
-- Indexes for table `sgp_hozmegamenu`
--
ALTER TABLE `sgp_hozmegamenu`
  ADD PRIMARY KEY (`hozmegamenu_id`);

--
-- Indexes for table `sgp_importexport_importdata`
--
ALTER TABLE `sgp_importexport_importdata`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `sgp_import_history`
--
ALTER TABLE `sgp_import_history`
  ADD PRIMARY KEY (`history_id`);

--
-- Indexes for table `sgp_indexer_state`
--
ALTER TABLE `sgp_indexer_state`
  ADD PRIMARY KEY (`state_id`),
  ADD KEY `SGP_INDEXER_STATE_INDEXER_ID` (`indexer_id`);

--
-- Indexes for table `sgp_integration`
--
ALTER TABLE `sgp_integration`
  ADD PRIMARY KEY (`integration_id`),
  ADD UNIQUE KEY `SGP_INTEGRATION_NAME` (`name`),
  ADD UNIQUE KEY `SGP_INTEGRATION_CONSUMER_ID` (`consumer_id`);

--
-- Indexes for table `sgp_layout_link`
--
ALTER TABLE `sgp_layout_link`
  ADD PRIMARY KEY (`layout_link_id`),
  ADD KEY `SGP_LAYOUT_LINK_LAYOUT_UPDATE_ID` (`layout_update_id`),
  ADD KEY `SGP_LAYOUT_LINK_STORE_ID_THEME_ID_LAYOUT_UPDATE_ID_IS_TEMPORARY` (`store_id`,`theme_id`,`layout_update_id`,`is_temporary`),
  ADD KEY `SGP_LAYOUT_LINK_THEME_ID_THEME_THEME_ID` (`theme_id`);

--
-- Indexes for table `sgp_layout_update`
--
ALTER TABLE `sgp_layout_update`
  ADD PRIMARY KEY (`layout_update_id`),
  ADD KEY `SGP_LAYOUT_UPDATE_HANDLE` (`handle`);

--
-- Indexes for table `sgp_mview_state`
--
ALTER TABLE `sgp_mview_state`
  ADD PRIMARY KEY (`state_id`),
  ADD KEY `SGP_MVIEW_STATE_VIEW_ID` (`view_id`),
  ADD KEY `SGP_MVIEW_STATE_MODE` (`mode`);

--
-- Indexes for table `sgp_newsletter_problem`
--
ALTER TABLE `sgp_newsletter_problem`
  ADD PRIMARY KEY (`problem_id`),
  ADD KEY `SGP_NEWSLETTER_PROBLEM_SUBSCRIBER_ID` (`subscriber_id`),
  ADD KEY `SGP_NEWSLETTER_PROBLEM_QUEUE_ID` (`queue_id`);

--
-- Indexes for table `sgp_newsletter_queue`
--
ALTER TABLE `sgp_newsletter_queue`
  ADD PRIMARY KEY (`queue_id`),
  ADD KEY `SGP_NEWSLETTER_QUEUE_TEMPLATE_ID` (`template_id`);

--
-- Indexes for table `sgp_newsletter_queue_link`
--
ALTER TABLE `sgp_newsletter_queue_link`
  ADD PRIMARY KEY (`queue_link_id`),
  ADD KEY `SGP_NEWSLETTER_QUEUE_LINK_SUBSCRIBER_ID` (`subscriber_id`),
  ADD KEY `SGP_NEWSLETTER_QUEUE_LINK_QUEUE_ID_LETTER_SENT_AT` (`queue_id`,`letter_sent_at`);

--
-- Indexes for table `sgp_newsletter_queue_store_link`
--
ALTER TABLE `sgp_newsletter_queue_store_link`
  ADD PRIMARY KEY (`queue_id`,`store_id`),
  ADD KEY `SGP_NEWSLETTER_QUEUE_STORE_LINK_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_newsletter_template`
--
ALTER TABLE `sgp_newsletter_template`
  ADD PRIMARY KEY (`template_id`),
  ADD KEY `SGP_NEWSLETTER_TEMPLATE_TEMPLATE_ACTUAL` (`template_actual`),
  ADD KEY `SGP_NEWSLETTER_TEMPLATE_ADDED_AT` (`added_at`),
  ADD KEY `SGP_NEWSLETTER_TEMPLATE_MODIFIED_AT` (`modified_at`);

--
-- Indexes for table `sgp_oauth_consumer`
--
ALTER TABLE `sgp_oauth_consumer`
  ADD PRIMARY KEY (`entity_id`),
  ADD UNIQUE KEY `SGP_OAUTH_CONSUMER_KEY` (`key`),
  ADD UNIQUE KEY `SGP_OAUTH_CONSUMER_SECRET` (`secret`),
  ADD KEY `SGP_OAUTH_CONSUMER_CREATED_AT` (`created_at`),
  ADD KEY `SGP_OAUTH_CONSUMER_UPDATED_AT` (`updated_at`);

--
-- Indexes for table `sgp_oauth_nonce`
--
ALTER TABLE `sgp_oauth_nonce`
  ADD UNIQUE KEY `SGP_OAUTH_NONCE_NONCE_CONSUMER_ID` (`nonce`,`consumer_id`),
  ADD KEY `SGP_OAUTH_NONCE_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID` (`consumer_id`);

--
-- Indexes for table `sgp_oauth_token`
--
ALTER TABLE `sgp_oauth_token`
  ADD PRIMARY KEY (`entity_id`),
  ADD UNIQUE KEY `SGP_OAUTH_TOKEN_TOKEN` (`token`),
  ADD KEY `SGP_OAUTH_TOKEN_CONSUMER_ID` (`consumer_id`),
  ADD KEY `SGP_OAUTH_TOKEN_ADMIN_ID_ADMIN_USER_USER_ID` (`admin_id`),
  ADD KEY `SGP_OAUTH_TOKEN_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` (`customer_id`);

--
-- Indexes for table `sgp_oauth_token_request_log`
--
ALTER TABLE `sgp_oauth_token_request_log`
  ADD PRIMARY KEY (`log_id`),
  ADD UNIQUE KEY `SGP_OAUTH_TOKEN_REQUEST_LOG_USER_NAME_USER_TYPE` (`user_name`,`user_type`);

--
-- Indexes for table `sgp_password_reset_request_event`
--
ALTER TABLE `sgp_password_reset_request_event`
  ADD PRIMARY KEY (`id`),
  ADD KEY `SGP_PASSWORD_RESET_REQUEST_EVENT_ACCOUNT_REFERENCE` (`account_reference`),
  ADD KEY `SGP_PASSWORD_RESET_REQUEST_EVENT_CREATED_AT` (`created_at`);

--
-- Indexes for table `sgp_paypal_billing_agreement`
--
ALTER TABLE `sgp_paypal_billing_agreement`
  ADD PRIMARY KEY (`agreement_id`),
  ADD KEY `SGP_PAYPAL_BILLING_AGREEMENT_CUSTOMER_ID` (`customer_id`),
  ADD KEY `SGP_PAYPAL_BILLING_AGREEMENT_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_paypal_billing_agreement_order`
--
ALTER TABLE `sgp_paypal_billing_agreement_order`
  ADD PRIMARY KEY (`agreement_id`,`order_id`),
  ADD KEY `SGP_PAYPAL_BILLING_AGREEMENT_ORDER_ORDER_ID` (`order_id`);

--
-- Indexes for table `sgp_paypal_cert`
--
ALTER TABLE `sgp_paypal_cert`
  ADD PRIMARY KEY (`cert_id`),
  ADD KEY `SGP_PAYPAL_CERT_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_paypal_payment_transaction`
--
ALTER TABLE `sgp_paypal_payment_transaction`
  ADD PRIMARY KEY (`transaction_id`),
  ADD UNIQUE KEY `SGP_PAYPAL_PAYMENT_TRANSACTION_TXN_ID` (`txn_id`);

--
-- Indexes for table `sgp_paypal_settlement_report`
--
ALTER TABLE `sgp_paypal_settlement_report`
  ADD PRIMARY KEY (`report_id`),
  ADD UNIQUE KEY `SGP_PAYPAL_SETTLEMENT_REPORT_REPORT_DATE_ACCOUNT_ID` (`report_date`,`account_id`);

--
-- Indexes for table `sgp_paypal_settlement_report_row`
--
ALTER TABLE `sgp_paypal_settlement_report_row`
  ADD PRIMARY KEY (`row_id`),
  ADD KEY `SGP_PAYPAL_SETTLEMENT_REPORT_ROW_REPORT_ID` (`report_id`);

--
-- Indexes for table `sgp_persistent_session`
--
ALTER TABLE `sgp_persistent_session`
  ADD PRIMARY KEY (`persistent_id`),
  ADD UNIQUE KEY `SGP_PERSISTENT_SESSION_KEY` (`key`),
  ADD UNIQUE KEY `SGP_PERSISTENT_SESSION_CUSTOMER_ID` (`customer_id`),
  ADD KEY `SGP_PERSISTENT_SESSION_UPDATED_AT` (`updated_at`),
  ADD KEY `SGP_PERSISTENT_SESSION_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_plazathemes_blog_category`
--
ALTER TABLE `sgp_plazathemes_blog_category`
  ADD PRIMARY KEY (`category_id`),
  ADD KEY `SGP_PLAZATHEMES_BLOG_CATEGORY_IDENTIFIER` (`identifier`);
ALTER TABLE `sgp_plazathemes_blog_category` ADD FULLTEXT KEY `FTI_6F93114DFCA1C71C3E1F863BB246D4FC` (`title`,`meta_keywords`,`meta_description`,`identifier`,`content`);

--
-- Indexes for table `sgp_plazathemes_blog_category_store`
--
ALTER TABLE `sgp_plazathemes_blog_category_store`
  ADD PRIMARY KEY (`category_id`,`store_id`),
  ADD KEY `SGP_PLAZATHEMES_BLOG_CATEGORY_STORE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_plazathemes_blog_post`
--
ALTER TABLE `sgp_plazathemes_blog_post`
  ADD PRIMARY KEY (`post_id`),
  ADD KEY `SGP_PLAZATHEMES_BLOG_POST_IDENTIFIER` (`identifier`);
ALTER TABLE `sgp_plazathemes_blog_post` ADD FULLTEXT KEY `FTI_FA898384119A0AE404584AD33150B5E8` (`title`,`meta_keywords`,`meta_description`,`identifier`,`content`);

--
-- Indexes for table `sgp_plazathemes_blog_post_category`
--
ALTER TABLE `sgp_plazathemes_blog_post_category`
  ADD PRIMARY KEY (`post_id`,`category_id`),
  ADD KEY `SGP_PLAZATHEMES_BLOG_POST_CATEGORY_CATEGORY_ID` (`category_id`);

--
-- Indexes for table `sgp_plazathemes_blog_post_relatedpost`
--
ALTER TABLE `sgp_plazathemes_blog_post_relatedpost`
  ADD PRIMARY KEY (`post_id`,`related_id`),
  ADD KEY `SGP_PLAZATHEMES_BLOG_POST_RELATEDPRODUCT_RELATED_ID` (`related_id`);

--
-- Indexes for table `sgp_plazathemes_blog_post_relatedproduct`
--
ALTER TABLE `sgp_plazathemes_blog_post_relatedproduct`
  ADD PRIMARY KEY (`post_id`,`related_id`),
  ADD KEY `SGP_PLAZATHEMES_BLOG_POST_RELATEDPRODUCT_RELATED_ID` (`related_id`);

--
-- Indexes for table `sgp_plazathemes_blog_post_store`
--
ALTER TABLE `sgp_plazathemes_blog_post_store`
  ADD PRIMARY KEY (`post_id`,`store_id`),
  ADD KEY `SGP_PLAZATHEMES_BLOG_POST_STORE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_product_alert_price`
--
ALTER TABLE `sgp_product_alert_price`
  ADD PRIMARY KEY (`alert_price_id`),
  ADD KEY `SGP_PRODUCT_ALERT_PRICE_CUSTOMER_ID` (`customer_id`),
  ADD KEY `SGP_PRODUCT_ALERT_PRICE_PRODUCT_ID` (`product_id`),
  ADD KEY `SGP_PRODUCT_ALERT_PRICE_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_product_alert_stock`
--
ALTER TABLE `sgp_product_alert_stock`
  ADD PRIMARY KEY (`alert_stock_id`),
  ADD KEY `SGP_PRODUCT_ALERT_STOCK_CUSTOMER_ID` (`customer_id`),
  ADD KEY `SGP_PRODUCT_ALERT_STOCK_PRODUCT_ID` (`product_id`),
  ADD KEY `SGP_PRODUCT_ALERT_STOCK_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_pt_bannerslider`
--
ALTER TABLE `sgp_pt_bannerslider`
  ADD PRIMARY KEY (`banner_id`);

--
-- Indexes for table `sgp_pt_brandslider`
--
ALTER TABLE `sgp_pt_brandslider`
  ADD PRIMARY KEY (`brand_id`);

--
-- Indexes for table `sgp_pt_testimonial`
--
ALTER TABLE `sgp_pt_testimonial`
  ADD PRIMARY KEY (`testimo_id`);

--
-- Indexes for table `sgp_quote_address`
--
ALTER TABLE `sgp_quote_address`
  ADD PRIMARY KEY (`address_id`),
  ADD KEY `SGP_QUOTE_ADDRESS_QUOTE_ID` (`quote_id`);

--
-- Indexes for table `sgp_quote_address_item`
--
ALTER TABLE `sgp_quote_address_item`
  ADD PRIMARY KEY (`address_item_id`),
  ADD KEY `SGP_QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS_ID` (`quote_address_id`),
  ADD KEY `SGP_QUOTE_ADDRESS_ITEM_PARENT_ITEM_ID` (`parent_item_id`),
  ADD KEY `SGP_QUOTE_ADDRESS_ITEM_QUOTE_ITEM_ID` (`quote_item_id`);

--
-- Indexes for table `sgp_quote_id_mask`
--
ALTER TABLE `sgp_quote_id_mask`
  ADD PRIMARY KEY (`entity_id`,`quote_id`),
  ADD KEY `SGP_QUOTE_ID_MASK_QUOTE_ID` (`quote_id`),
  ADD KEY `SGP_QUOTE_ID_MASK_MASKED_ID` (`masked_id`);

--
-- Indexes for table `sgp_quote_item`
--
ALTER TABLE `sgp_quote_item`
  ADD PRIMARY KEY (`item_id`),
  ADD KEY `SGP_QUOTE_ITEM_PARENT_ITEM_ID` (`parent_item_id`),
  ADD KEY `SGP_QUOTE_ITEM_PRODUCT_ID` (`product_id`),
  ADD KEY `SGP_QUOTE_ITEM_QUOTE_ID` (`quote_id`),
  ADD KEY `SGP_QUOTE_ITEM_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_quote_item_option`
--
ALTER TABLE `sgp_quote_item_option`
  ADD PRIMARY KEY (`option_id`),
  ADD KEY `SGP_QUOTE_ITEM_OPTION_ITEM_ID` (`item_id`);

--
-- Indexes for table `sgp_quote_shipping_rate`
--
ALTER TABLE `sgp_quote_shipping_rate`
  ADD PRIMARY KEY (`rate_id`),
  ADD KEY `SGP_QUOTE_SHIPPING_RATE_ADDRESS_ID` (`address_id`);

--
-- Indexes for table `sgp_rating`
--
ALTER TABLE `sgp_rating`
  ADD PRIMARY KEY (`rating_id`),
  ADD UNIQUE KEY `SGP_RATING_RATING_CODE` (`rating_code`),
  ADD KEY `SGP_RATING_ENTITY_ID` (`entity_id`);

--
-- Indexes for table `sgp_rating_entity`
--
ALTER TABLE `sgp_rating_entity`
  ADD PRIMARY KEY (`entity_id`),
  ADD UNIQUE KEY `SGP_RATING_ENTITY_ENTITY_CODE` (`entity_code`);

--
-- Indexes for table `sgp_rating_option`
--
ALTER TABLE `sgp_rating_option`
  ADD PRIMARY KEY (`option_id`),
  ADD KEY `SGP_RATING_OPTION_RATING_ID` (`rating_id`);

--
-- Indexes for table `sgp_rating_option_vote`
--
ALTER TABLE `sgp_rating_option_vote`
  ADD PRIMARY KEY (`vote_id`),
  ADD KEY `SGP_RATING_OPTION_VOTE_OPTION_ID` (`option_id`),
  ADD KEY `SGP_RATING_OPTION_VOTE_REVIEW_ID_REVIEW_REVIEW_ID` (`review_id`);

--
-- Indexes for table `sgp_rating_option_vote_aggregated`
--
ALTER TABLE `sgp_rating_option_vote_aggregated`
  ADD PRIMARY KEY (`primary_id`),
  ADD KEY `SGP_RATING_OPTION_VOTE_AGGREGATED_RATING_ID` (`rating_id`),
  ADD KEY `SGP_RATING_OPTION_VOTE_AGGREGATED_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_rating_store`
--
ALTER TABLE `sgp_rating_store`
  ADD PRIMARY KEY (`rating_id`,`store_id`),
  ADD KEY `SGP_RATING_STORE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_rating_title`
--
ALTER TABLE `sgp_rating_title`
  ADD PRIMARY KEY (`rating_id`,`store_id`),
  ADD KEY `SGP_RATING_TITLE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_reporting_counts`
--
ALTER TABLE `sgp_reporting_counts`
  ADD PRIMARY KEY (`entity_id`);

--
-- Indexes for table `sgp_reporting_module_status`
--
ALTER TABLE `sgp_reporting_module_status`
  ADD PRIMARY KEY (`entity_id`);

--
-- Indexes for table `sgp_reporting_orders`
--
ALTER TABLE `sgp_reporting_orders`
  ADD PRIMARY KEY (`entity_id`);

--
-- Indexes for table `sgp_reporting_system_updates`
--
ALTER TABLE `sgp_reporting_system_updates`
  ADD PRIMARY KEY (`entity_id`);

--
-- Indexes for table `sgp_reporting_users`
--
ALTER TABLE `sgp_reporting_users`
  ADD PRIMARY KEY (`entity_id`);

--
-- Indexes for table `sgp_report_compared_product_index`
--
ALTER TABLE `sgp_report_compared_product_index`
  ADD PRIMARY KEY (`index_id`),
  ADD UNIQUE KEY `SGP_REPORT_COMPARED_PRODUCT_INDEX_VISITOR_ID_PRODUCT_ID` (`visitor_id`,`product_id`),
  ADD UNIQUE KEY `SGP_REPORT_COMPARED_PRODUCT_INDEX_CUSTOMER_ID_PRODUCT_ID` (`customer_id`,`product_id`),
  ADD KEY `SGP_REPORT_COMPARED_PRODUCT_INDEX_STORE_ID` (`store_id`),
  ADD KEY `SGP_REPORT_COMPARED_PRODUCT_INDEX_ADDED_AT` (`added_at`),
  ADD KEY `SGP_REPORT_COMPARED_PRODUCT_INDEX_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_report_event`
--
ALTER TABLE `sgp_report_event`
  ADD PRIMARY KEY (`event_id`),
  ADD KEY `SGP_REPORT_EVENT_EVENT_TYPE_ID` (`event_type_id`),
  ADD KEY `SGP_REPORT_EVENT_SUBJECT_ID` (`subject_id`),
  ADD KEY `SGP_REPORT_EVENT_OBJECT_ID` (`object_id`),
  ADD KEY `SGP_REPORT_EVENT_SUBTYPE` (`subtype`),
  ADD KEY `SGP_REPORT_EVENT_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_report_event_types`
--
ALTER TABLE `sgp_report_event_types`
  ADD PRIMARY KEY (`event_type_id`);

--
-- Indexes for table `sgp_report_viewed_product_aggregated_daily`
--
ALTER TABLE `sgp_report_viewed_product_aggregated_daily`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `SGP_REPORT_VIEWED_PRD_AGGRED_DAILY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  ADD KEY `SGP_REPORT_VIEWED_PRODUCT_AGGREGATED_DAILY_STORE_ID` (`store_id`),
  ADD KEY `SGP_REPORT_VIEWED_PRODUCT_AGGREGATED_DAILY_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_report_viewed_product_aggregated_monthly`
--
ALTER TABLE `sgp_report_viewed_product_aggregated_monthly`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `SGP_REPORT_VIEWED_PRD_AGGRED_MONTHLY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  ADD KEY `SGP_REPORT_VIEWED_PRODUCT_AGGREGATED_MONTHLY_STORE_ID` (`store_id`),
  ADD KEY `SGP_REPORT_VIEWED_PRODUCT_AGGREGATED_MONTHLY_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_report_viewed_product_aggregated_yearly`
--
ALTER TABLE `sgp_report_viewed_product_aggregated_yearly`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `SGP_REPORT_VIEWED_PRD_AGGRED_YEARLY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  ADD KEY `SGP_REPORT_VIEWED_PRODUCT_AGGREGATED_YEARLY_STORE_ID` (`store_id`),
  ADD KEY `SGP_REPORT_VIEWED_PRODUCT_AGGREGATED_YEARLY_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_report_viewed_product_index`
--
ALTER TABLE `sgp_report_viewed_product_index`
  ADD PRIMARY KEY (`index_id`),
  ADD UNIQUE KEY `SGP_REPORT_VIEWED_PRODUCT_INDEX_VISITOR_ID_PRODUCT_ID` (`visitor_id`,`product_id`),
  ADD UNIQUE KEY `SGP_REPORT_VIEWED_PRODUCT_INDEX_CUSTOMER_ID_PRODUCT_ID` (`customer_id`,`product_id`),
  ADD KEY `SGP_REPORT_VIEWED_PRODUCT_INDEX_STORE_ID` (`store_id`),
  ADD KEY `SGP_REPORT_VIEWED_PRODUCT_INDEX_ADDED_AT` (`added_at`),
  ADD KEY `SGP_REPORT_VIEWED_PRODUCT_INDEX_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_review`
--
ALTER TABLE `sgp_review`
  ADD PRIMARY KEY (`review_id`),
  ADD KEY `SGP_REVIEW_ENTITY_ID` (`entity_id`),
  ADD KEY `SGP_REVIEW_STATUS_ID` (`status_id`),
  ADD KEY `SGP_REVIEW_ENTITY_PK_VALUE` (`entity_pk_value`);

--
-- Indexes for table `sgp_review_detail`
--
ALTER TABLE `sgp_review_detail`
  ADD PRIMARY KEY (`detail_id`),
  ADD KEY `SGP_REVIEW_DETAIL_REVIEW_ID` (`review_id`),
  ADD KEY `SGP_REVIEW_DETAIL_STORE_ID` (`store_id`),
  ADD KEY `SGP_REVIEW_DETAIL_CUSTOMER_ID` (`customer_id`);

--
-- Indexes for table `sgp_review_entity`
--
ALTER TABLE `sgp_review_entity`
  ADD PRIMARY KEY (`entity_id`);

--
-- Indexes for table `sgp_review_entity_summary`
--
ALTER TABLE `sgp_review_entity_summary`
  ADD PRIMARY KEY (`primary_id`),
  ADD KEY `SGP_REVIEW_ENTITY_SUMMARY_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_review_status`
--
ALTER TABLE `sgp_review_status`
  ADD PRIMARY KEY (`status_id`);

--
-- Indexes for table `sgp_review_store`
--
ALTER TABLE `sgp_review_store`
  ADD PRIMARY KEY (`review_id`,`store_id`),
  ADD KEY `SGP_REVIEW_STORE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_salesrule`
--
ALTER TABLE `sgp_salesrule`
  ADD PRIMARY KEY (`rule_id`),
  ADD KEY `SGP_SALESRULE_IS_ACTIVE_SORT_ORDER_TO_DATE_FROM_DATE` (`is_active`,`sort_order`,`to_date`,`from_date`);

--
-- Indexes for table `sgp_salesrule_coupon`
--
ALTER TABLE `sgp_salesrule_coupon`
  ADD PRIMARY KEY (`coupon_id`),
  ADD UNIQUE KEY `SGP_SALESRULE_COUPON_CODE` (`code`),
  ADD UNIQUE KEY `SGP_SALESRULE_COUPON_RULE_ID_IS_PRIMARY` (`rule_id`,`is_primary`),
  ADD KEY `SGP_SALESRULE_COUPON_RULE_ID` (`rule_id`);

--
-- Indexes for table `sgp_salesrule_coupon_aggregated`
--
ALTER TABLE `sgp_salesrule_coupon_aggregated`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNQ_59BD71031FCD52C0169CE3350182F3BB` (`period`,`store_id`,`order_status`,`coupon_code`),
  ADD KEY `SGP_SALESRULE_COUPON_AGGREGATED_STORE_ID` (`store_id`),
  ADD KEY `SGP_SALESRULE_COUPON_AGGREGATED_RULE_NAME` (`rule_name`);

--
-- Indexes for table `sgp_salesrule_coupon_aggregated_order`
--
ALTER TABLE `sgp_salesrule_coupon_aggregated_order`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNQ_9CE2550E175337EA684740D8E041A352` (`period`,`store_id`,`order_status`,`coupon_code`),
  ADD KEY `SGP_SALESRULE_COUPON_AGGREGATED_ORDER_STORE_ID` (`store_id`),
  ADD KEY `SGP_SALESRULE_COUPON_AGGREGATED_ORDER_RULE_NAME` (`rule_name`);

--
-- Indexes for table `sgp_salesrule_coupon_aggregated_updated`
--
ALTER TABLE `sgp_salesrule_coupon_aggregated_updated`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNQ_30F6236F8E6F7A73B7B4C0AB72F68597` (`period`,`store_id`,`order_status`,`coupon_code`),
  ADD KEY `SGP_SALESRULE_COUPON_AGGREGATED_UPDATED_STORE_ID` (`store_id`),
  ADD KEY `SGP_SALESRULE_COUPON_AGGREGATED_UPDATED_RULE_NAME` (`rule_name`);

--
-- Indexes for table `sgp_salesrule_coupon_usage`
--
ALTER TABLE `sgp_salesrule_coupon_usage`
  ADD PRIMARY KEY (`coupon_id`,`customer_id`),
  ADD KEY `SGP_SALESRULE_COUPON_USAGE_CUSTOMER_ID` (`customer_id`);

--
-- Indexes for table `sgp_salesrule_customer`
--
ALTER TABLE `sgp_salesrule_customer`
  ADD PRIMARY KEY (`rule_customer_id`),
  ADD KEY `SGP_SALESRULE_CUSTOMER_RULE_ID_CUSTOMER_ID` (`rule_id`,`customer_id`),
  ADD KEY `SGP_SALESRULE_CUSTOMER_CUSTOMER_ID_RULE_ID` (`customer_id`,`rule_id`);

--
-- Indexes for table `sgp_salesrule_customer_group`
--
ALTER TABLE `sgp_salesrule_customer_group`
  ADD PRIMARY KEY (`rule_id`,`customer_group_id`),
  ADD KEY `SGP_SALESRULE_CUSTOMER_GROUP_CUSTOMER_GROUP_ID` (`customer_group_id`);

--
-- Indexes for table `sgp_salesrule_label`
--
ALTER TABLE `sgp_salesrule_label`
  ADD PRIMARY KEY (`label_id`),
  ADD UNIQUE KEY `SGP_SALESRULE_LABEL_RULE_ID_STORE_ID` (`rule_id`,`store_id`),
  ADD KEY `SGP_SALESRULE_LABEL_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_salesrule_product_attribute`
--
ALTER TABLE `sgp_salesrule_product_attribute`
  ADD PRIMARY KEY (`rule_id`,`website_id`,`customer_group_id`,`attribute_id`),
  ADD KEY `SGP_SALESRULE_PRODUCT_ATTRIBUTE_WEBSITE_ID` (`website_id`),
  ADD KEY `SGP_SALESRULE_PRODUCT_ATTRIBUTE_CUSTOMER_GROUP_ID` (`customer_group_id`),
  ADD KEY `SGP_SALESRULE_PRODUCT_ATTRIBUTE_ATTRIBUTE_ID` (`attribute_id`);

--
-- Indexes for table `sgp_salesrule_website`
--
ALTER TABLE `sgp_salesrule_website`
  ADD PRIMARY KEY (`rule_id`,`website_id`),
  ADD KEY `SGP_SALESRULE_WEBSITE_WEBSITE_ID` (`website_id`);

--
-- Indexes for table `sgp_sales_bestsellers_aggregated_daily`
--
ALTER TABLE `sgp_sales_bestsellers_aggregated_daily`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `SGP_SALES_BESTSELLERS_AGGRED_DAILY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  ADD KEY `SGP_SALES_BESTSELLERS_AGGREGATED_DAILY_STORE_ID` (`store_id`),
  ADD KEY `SGP_SALES_BESTSELLERS_AGGREGATED_DAILY_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_sales_bestsellers_aggregated_monthly`
--
ALTER TABLE `sgp_sales_bestsellers_aggregated_monthly`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `SGP_SALES_BESTSELLERS_AGGRED_MONTHLY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  ADD KEY `SGP_SALES_BESTSELLERS_AGGREGATED_MONTHLY_STORE_ID` (`store_id`),
  ADD KEY `SGP_SALES_BESTSELLERS_AGGREGATED_MONTHLY_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_sales_bestsellers_aggregated_yearly`
--
ALTER TABLE `sgp_sales_bestsellers_aggregated_yearly`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `SGP_SALES_BESTSELLERS_AGGRED_YEARLY_PERIOD_STORE_ID_PRD_ID` (`period`,`store_id`,`product_id`),
  ADD KEY `SGP_SALES_BESTSELLERS_AGGREGATED_YEARLY_STORE_ID` (`store_id`),
  ADD KEY `SGP_SALES_BESTSELLERS_AGGREGATED_YEARLY_PRODUCT_ID` (`product_id`);

--
-- Indexes for table `sgp_sales_creditmemo`
--
ALTER TABLE `sgp_sales_creditmemo`
  ADD PRIMARY KEY (`entity_id`),
  ADD UNIQUE KEY `SGP_SALES_CREDITMEMO_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  ADD KEY `SGP_SALES_CREDITMEMO_STORE_ID` (`store_id`),
  ADD KEY `SGP_SALES_CREDITMEMO_ORDER_ID` (`order_id`),
  ADD KEY `SGP_SALES_CREDITMEMO_CREDITMEMO_STATUS` (`creditmemo_status`),
  ADD KEY `SGP_SALES_CREDITMEMO_STATE` (`state`),
  ADD KEY `SGP_SALES_CREDITMEMO_CREATED_AT` (`created_at`),
  ADD KEY `SGP_SALES_CREDITMEMO_UPDATED_AT` (`updated_at`),
  ADD KEY `SGP_SALES_CREDITMEMO_SEND_EMAIL` (`send_email`),
  ADD KEY `SGP_SALES_CREDITMEMO_EMAIL_SENT` (`email_sent`);

--
-- Indexes for table `sgp_sales_creditmemo_comment`
--
ALTER TABLE `sgp_sales_creditmemo_comment`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_SALES_CREDITMEMO_COMMENT_CREATED_AT` (`created_at`),
  ADD KEY `SGP_SALES_CREDITMEMO_COMMENT_PARENT_ID` (`parent_id`);

--
-- Indexes for table `sgp_sales_creditmemo_grid`
--
ALTER TABLE `sgp_sales_creditmemo_grid`
  ADD PRIMARY KEY (`entity_id`),
  ADD UNIQUE KEY `SGP_SALES_CREDITMEMO_GRID_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  ADD KEY `SGP_SALES_CREDITMEMO_GRID_ORDER_INCREMENT_ID` (`order_increment_id`),
  ADD KEY `SGP_SALES_CREDITMEMO_GRID_CREATED_AT` (`created_at`),
  ADD KEY `SGP_SALES_CREDITMEMO_GRID_UPDATED_AT` (`updated_at`),
  ADD KEY `SGP_SALES_CREDITMEMO_GRID_ORDER_CREATED_AT` (`order_created_at`),
  ADD KEY `SGP_SALES_CREDITMEMO_GRID_STATE` (`state`),
  ADD KEY `SGP_SALES_CREDITMEMO_GRID_BILLING_NAME` (`billing_name`),
  ADD KEY `SGP_SALES_CREDITMEMO_GRID_ORDER_STATUS` (`order_status`),
  ADD KEY `SGP_SALES_CREDITMEMO_GRID_BASE_GRAND_TOTAL` (`base_grand_total`),
  ADD KEY `SGP_SALES_CREDITMEMO_GRID_STORE_ID` (`store_id`),
  ADD KEY `SGP_SALES_CREDITMEMO_GRID_ORDER_BASE_GRAND_TOTAL` (`order_base_grand_total`),
  ADD KEY `SGP_SALES_CREDITMEMO_GRID_ORDER_ID` (`order_id`);
ALTER TABLE `sgp_sales_creditmemo_grid` ADD FULLTEXT KEY `FTI_711ED88A79389DE67FE488ECCE974E41` (`increment_id`,`order_increment_id`,`billing_name`,`billing_address`,`shipping_address`,`customer_name`,`customer_email`);

--
-- Indexes for table `sgp_sales_creditmemo_item`
--
ALTER TABLE `sgp_sales_creditmemo_item`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_SALES_CREDITMEMO_ITEM_PARENT_ID` (`parent_id`);

--
-- Indexes for table `sgp_sales_invoice`
--
ALTER TABLE `sgp_sales_invoice`
  ADD PRIMARY KEY (`entity_id`),
  ADD UNIQUE KEY `SGP_SALES_INVOICE_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  ADD KEY `SGP_SALES_INVOICE_STORE_ID` (`store_id`),
  ADD KEY `SGP_SALES_INVOICE_GRAND_TOTAL` (`grand_total`),
  ADD KEY `SGP_SALES_INVOICE_ORDER_ID` (`order_id`),
  ADD KEY `SGP_SALES_INVOICE_STATE` (`state`),
  ADD KEY `SGP_SALES_INVOICE_CREATED_AT` (`created_at`),
  ADD KEY `SGP_SALES_INVOICE_UPDATED_AT` (`updated_at`),
  ADD KEY `SGP_SALES_INVOICE_SEND_EMAIL` (`send_email`),
  ADD KEY `SGP_SALES_INVOICE_EMAIL_SENT` (`email_sent`);

--
-- Indexes for table `sgp_sales_invoiced_aggregated`
--
ALTER TABLE `sgp_sales_invoiced_aggregated`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `SGP_SALES_INVOICED_AGGREGATED_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  ADD KEY `SGP_SALES_INVOICED_AGGREGATED_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_sales_invoiced_aggregated_order`
--
ALTER TABLE `sgp_sales_invoiced_aggregated_order`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `SGP_SALES_INVOICED_AGGREGATED_ORDER_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  ADD KEY `SGP_SALES_INVOICED_AGGREGATED_ORDER_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_sales_invoice_comment`
--
ALTER TABLE `sgp_sales_invoice_comment`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_SALES_INVOICE_COMMENT_CREATED_AT` (`created_at`),
  ADD KEY `SGP_SALES_INVOICE_COMMENT_PARENT_ID` (`parent_id`);

--
-- Indexes for table `sgp_sales_invoice_grid`
--
ALTER TABLE `sgp_sales_invoice_grid`
  ADD PRIMARY KEY (`entity_id`),
  ADD UNIQUE KEY `SGP_SALES_INVOICE_GRID_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  ADD KEY `SGP_SALES_INVOICE_GRID_STORE_ID` (`store_id`),
  ADD KEY `SGP_SALES_INVOICE_GRID_GRAND_TOTAL` (`grand_total`),
  ADD KEY `SGP_SALES_INVOICE_GRID_ORDER_ID` (`order_id`),
  ADD KEY `SGP_SALES_INVOICE_GRID_STATE` (`state`),
  ADD KEY `SGP_SALES_INVOICE_GRID_ORDER_INCREMENT_ID` (`order_increment_id`),
  ADD KEY `SGP_SALES_INVOICE_GRID_CREATED_AT` (`created_at`),
  ADD KEY `SGP_SALES_INVOICE_GRID_UPDATED_AT` (`updated_at`),
  ADD KEY `SGP_SALES_INVOICE_GRID_ORDER_CREATED_AT` (`order_created_at`),
  ADD KEY `SGP_SALES_INVOICE_GRID_BILLING_NAME` (`billing_name`),
  ADD KEY `SGP_SALES_INVOICE_GRID_BASE_GRAND_TOTAL` (`base_grand_total`);
ALTER TABLE `sgp_sales_invoice_grid` ADD FULLTEXT KEY `FTI_899545FB56C01A40D844D67353B290F2` (`increment_id`,`order_increment_id`,`billing_name`,`billing_address`,`shipping_address`,`customer_name`,`customer_email`);

--
-- Indexes for table `sgp_sales_invoice_item`
--
ALTER TABLE `sgp_sales_invoice_item`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_SALES_INVOICE_ITEM_PARENT_ID` (`parent_id`);

--
-- Indexes for table `sgp_sales_order_address`
--
ALTER TABLE `sgp_sales_order_address`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_SALES_ORDER_ADDRESS_PARENT_ID` (`parent_id`);

--
-- Indexes for table `sgp_sales_order_aggregated_created`
--
ALTER TABLE `sgp_sales_order_aggregated_created`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `SGP_SALES_ORDER_AGGREGATED_CREATED_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  ADD KEY `SGP_SALES_ORDER_AGGREGATED_CREATED_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_sales_order_aggregated_updated`
--
ALTER TABLE `sgp_sales_order_aggregated_updated`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `SGP_SALES_ORDER_AGGREGATED_UPDATED_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  ADD KEY `SGP_SALES_ORDER_AGGREGATED_UPDATED_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_sales_order_grid`
--
ALTER TABLE `sgp_sales_order_grid`
  ADD PRIMARY KEY (`entity_id`),
  ADD UNIQUE KEY `SGP_SALES_ORDER_GRID_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  ADD KEY `SGP_SALES_ORDER_GRID_STATUS` (`status`),
  ADD KEY `SGP_SALES_ORDER_GRID_STORE_ID` (`store_id`),
  ADD KEY `SGP_SALES_ORDER_GRID_BASE_GRAND_TOTAL` (`base_grand_total`),
  ADD KEY `SGP_SALES_ORDER_GRID_BASE_TOTAL_PAID` (`base_total_paid`),
  ADD KEY `SGP_SALES_ORDER_GRID_GRAND_TOTAL` (`grand_total`),
  ADD KEY `SGP_SALES_ORDER_GRID_TOTAL_PAID` (`total_paid`),
  ADD KEY `SGP_SALES_ORDER_GRID_SHIPPING_NAME` (`shipping_name`),
  ADD KEY `SGP_SALES_ORDER_GRID_BILLING_NAME` (`billing_name`),
  ADD KEY `SGP_SALES_ORDER_GRID_CREATED_AT` (`created_at`),
  ADD KEY `SGP_SALES_ORDER_GRID_CUSTOMER_ID` (`customer_id`),
  ADD KEY `SGP_SALES_ORDER_GRID_UPDATED_AT` (`updated_at`);
ALTER TABLE `sgp_sales_order_grid` ADD FULLTEXT KEY `FTI_DEC8F53DB0015B25E7259E4C23224023` (`increment_id`,`billing_name`,`shipping_name`,`shipping_address`,`billing_address`,`customer_name`,`customer_email`);

--
-- Indexes for table `sgp_sales_order_item`
--
ALTER TABLE `sgp_sales_order_item`
  ADD PRIMARY KEY (`item_id`),
  ADD KEY `SGP_SALES_ORDER_ITEM_ORDER_ID` (`order_id`),
  ADD KEY `SGP_SALES_ORDER_ITEM_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_sales_order_status`
--
ALTER TABLE `sgp_sales_order_status`
  ADD PRIMARY KEY (`status`);

--
-- Indexes for table `sgp_sales_order_status_history`
--
ALTER TABLE `sgp_sales_order_status_history`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_SALES_ORDER_STATUS_HISTORY_PARENT_ID` (`parent_id`),
  ADD KEY `SGP_SALES_ORDER_STATUS_HISTORY_CREATED_AT` (`created_at`);

--
-- Indexes for table `sgp_sales_order_status_label`
--
ALTER TABLE `sgp_sales_order_status_label`
  ADD PRIMARY KEY (`status`,`store_id`),
  ADD KEY `SGP_SALES_ORDER_STATUS_LABEL_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_sales_order_status_state`
--
ALTER TABLE `sgp_sales_order_status_state`
  ADD PRIMARY KEY (`status`,`state`);

--
-- Indexes for table `sgp_sales_order_tax`
--
ALTER TABLE `sgp_sales_order_tax`
  ADD PRIMARY KEY (`tax_id`),
  ADD KEY `SGP_SALES_ORDER_TAX_ORDER_ID_PRIORITY_POSITION` (`order_id`,`priority`,`position`);

--
-- Indexes for table `sgp_sales_order_tax_item`
--
ALTER TABLE `sgp_sales_order_tax_item`
  ADD PRIMARY KEY (`tax_item_id`),
  ADD UNIQUE KEY `SGP_SALES_ORDER_TAX_ITEM_TAX_ID_ITEM_ID` (`tax_id`,`item_id`),
  ADD KEY `SGP_SALES_ORDER_TAX_ITEM_ITEM_ID` (`item_id`),
  ADD KEY `FK_1F06A752705284673A359FFA44E7B645` (`associated_item_id`);

--
-- Indexes for table `sgp_sales_payment_transaction`
--
ALTER TABLE `sgp_sales_payment_transaction`
  ADD PRIMARY KEY (`transaction_id`),
  ADD UNIQUE KEY `SGP_SALES_PAYMENT_TRANSACTION_ORDER_ID_PAYMENT_ID_TXN_ID` (`order_id`,`payment_id`,`txn_id`),
  ADD KEY `SGP_SALES_PAYMENT_TRANSACTION_PARENT_ID` (`parent_id`),
  ADD KEY `SGP_SALES_PAYMENT_TRANSACTION_PAYMENT_ID` (`payment_id`);

--
-- Indexes for table `sgp_sales_refunded_aggregated`
--
ALTER TABLE `sgp_sales_refunded_aggregated`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `SGP_SALES_REFUNDED_AGGREGATED_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  ADD KEY `SGP_SALES_REFUNDED_AGGREGATED_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_sales_refunded_aggregated_order`
--
ALTER TABLE `sgp_sales_refunded_aggregated_order`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `SGP_SALES_REFUNDED_AGGREGATED_ORDER_PERIOD_STORE_ID_ORDER_STATUS` (`period`,`store_id`,`order_status`),
  ADD KEY `SGP_SALES_REFUNDED_AGGREGATED_ORDER_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_sales_sequence_meta`
--
ALTER TABLE `sgp_sales_sequence_meta`
  ADD PRIMARY KEY (`meta_id`),
  ADD UNIQUE KEY `SGP_SALES_SEQUENCE_META_ENTITY_TYPE_STORE_ID` (`entity_type`,`store_id`);

--
-- Indexes for table `sgp_sales_sequence_profile`
--
ALTER TABLE `sgp_sales_sequence_profile`
  ADD PRIMARY KEY (`profile_id`),
  ADD UNIQUE KEY `SGP_SALES_SEQUENCE_PROFILE_META_ID_PREFIX_SUFFIX` (`meta_id`,`prefix`,`suffix`);

--
-- Indexes for table `sgp_sales_shipment`
--
ALTER TABLE `sgp_sales_shipment`
  ADD PRIMARY KEY (`entity_id`),
  ADD UNIQUE KEY `SGP_SALES_SHIPMENT_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  ADD KEY `SGP_SALES_SHIPMENT_STORE_ID` (`store_id`),
  ADD KEY `SGP_SALES_SHIPMENT_TOTAL_QTY` (`total_qty`),
  ADD KEY `SGP_SALES_SHIPMENT_ORDER_ID` (`order_id`),
  ADD KEY `SGP_SALES_SHIPMENT_CREATED_AT` (`created_at`),
  ADD KEY `SGP_SALES_SHIPMENT_UPDATED_AT` (`updated_at`),
  ADD KEY `SGP_SALES_SHIPMENT_SEND_EMAIL` (`send_email`),
  ADD KEY `SGP_SALES_SHIPMENT_EMAIL_SENT` (`email_sent`);

--
-- Indexes for table `sgp_sales_shipment_comment`
--
ALTER TABLE `sgp_sales_shipment_comment`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_SALES_SHIPMENT_COMMENT_CREATED_AT` (`created_at`),
  ADD KEY `SGP_SALES_SHIPMENT_COMMENT_PARENT_ID` (`parent_id`);

--
-- Indexes for table `sgp_sales_shipment_grid`
--
ALTER TABLE `sgp_sales_shipment_grid`
  ADD PRIMARY KEY (`entity_id`),
  ADD UNIQUE KEY `SGP_SALES_SHIPMENT_GRID_INCREMENT_ID_STORE_ID` (`increment_id`,`store_id`),
  ADD KEY `SGP_SALES_SHIPMENT_GRID_STORE_ID` (`store_id`),
  ADD KEY `SGP_SALES_SHIPMENT_GRID_TOTAL_QTY` (`total_qty`),
  ADD KEY `SGP_SALES_SHIPMENT_GRID_ORDER_INCREMENT_ID` (`order_increment_id`),
  ADD KEY `SGP_SALES_SHIPMENT_GRID_SHIPMENT_STATUS` (`shipment_status`),
  ADD KEY `SGP_SALES_SHIPMENT_GRID_ORDER_STATUS` (`order_status`),
  ADD KEY `SGP_SALES_SHIPMENT_GRID_CREATED_AT` (`created_at`),
  ADD KEY `SGP_SALES_SHIPMENT_GRID_UPDATED_AT` (`updated_at`),
  ADD KEY `SGP_SALES_SHIPMENT_GRID_ORDER_CREATED_AT` (`order_created_at`),
  ADD KEY `SGP_SALES_SHIPMENT_GRID_SHIPPING_NAME` (`shipping_name`),
  ADD KEY `SGP_SALES_SHIPMENT_GRID_BILLING_NAME` (`billing_name`);
ALTER TABLE `sgp_sales_shipment_grid` ADD FULLTEXT KEY `FTI_75FB680EC0BDC5D7305B47572E29A11D` (`increment_id`,`order_increment_id`,`shipping_name`,`customer_name`,`customer_email`,`billing_address`,`shipping_address`);

--
-- Indexes for table `sgp_sales_shipment_item`
--
ALTER TABLE `sgp_sales_shipment_item`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_SALES_SHIPMENT_ITEM_PARENT_ID` (`parent_id`);

--
-- Indexes for table `sgp_sales_shipment_track`
--
ALTER TABLE `sgp_sales_shipment_track`
  ADD PRIMARY KEY (`entity_id`),
  ADD KEY `SGP_SALES_SHIPMENT_TRACK_PARENT_ID` (`parent_id`),
  ADD KEY `SGP_SALES_SHIPMENT_TRACK_ORDER_ID` (`order_id`),
  ADD KEY `SGP_SALES_SHIPMENT_TRACK_CREATED_AT` (`created_at`);

--
-- Indexes for table `sgp_sales_shipping_aggregated`
--
ALTER TABLE `sgp_sales_shipping_aggregated`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `SGP_SALES_SHPP_AGGRED_PERIOD_STORE_ID_ORDER_STS_SHPP_DESCRIPTION` (`period`,`store_id`,`order_status`,`shipping_description`),
  ADD KEY `SGP_SALES_SHIPPING_AGGREGATED_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_sales_shipping_aggregated_order`
--
ALTER TABLE `sgp_sales_shipping_aggregated_order`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNQ_37275A7A12CB683A89F101D6EEA688F2` (`period`,`store_id`,`order_status`,`shipping_description`),
  ADD KEY `SGP_SALES_SHIPPING_AGGREGATED_ORDER_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_search_query`
--
ALTER TABLE `sgp_search_query`
  ADD PRIMARY KEY (`query_id`),
  ADD UNIQUE KEY `SGP_SEARCH_QUERY_QUERY_TEXT_STORE_ID` (`query_text`,`store_id`),
  ADD KEY `SGP_SEARCH_QUERY_QUERY_TEXT_STORE_ID_POPULARITY` (`query_text`,`store_id`,`popularity`),
  ADD KEY `SGP_SEARCH_QUERY_STORE_ID` (`store_id`),
  ADD KEY `SGP_SEARCH_QUERY_IS_PROCESSED` (`is_processed`);

--
-- Indexes for table `sgp_search_synonyms`
--
ALTER TABLE `sgp_search_synonyms`
  ADD PRIMARY KEY (`group_id`),
  ADD KEY `SGP_SEARCH_SYNONYMS_STORE_ID` (`store_id`),
  ADD KEY `SGP_SEARCH_SYNONYMS_WEBSITE_ID` (`website_id`);
ALTER TABLE `sgp_search_synonyms` ADD FULLTEXT KEY `SGP_SEARCH_SYNONYMS_SYNONYMS` (`synonyms`);

--
-- Indexes for table `sgp_sendfriend_log`
--
ALTER TABLE `sgp_sendfriend_log`
  ADD PRIMARY KEY (`log_id`),
  ADD KEY `SGP_SENDFRIEND_LOG_IP` (`ip`),
  ADD KEY `SGP_SENDFRIEND_LOG_TIME` (`time`);

--
-- Indexes for table `sgp_sequence_creditmemo_0`
--
ALTER TABLE `sgp_sequence_creditmemo_0`
  ADD PRIMARY KEY (`sequence_value`);

--
-- Indexes for table `sgp_sequence_creditmemo_1`
--
ALTER TABLE `sgp_sequence_creditmemo_1`
  ADD PRIMARY KEY (`sequence_value`);

--
-- Indexes for table `sgp_sequence_invoice_0`
--
ALTER TABLE `sgp_sequence_invoice_0`
  ADD PRIMARY KEY (`sequence_value`);

--
-- Indexes for table `sgp_sequence_invoice_1`
--
ALTER TABLE `sgp_sequence_invoice_1`
  ADD PRIMARY KEY (`sequence_value`);

--
-- Indexes for table `sgp_sequence_order_0`
--
ALTER TABLE `sgp_sequence_order_0`
  ADD PRIMARY KEY (`sequence_value`);

--
-- Indexes for table `sgp_sequence_order_1`
--
ALTER TABLE `sgp_sequence_order_1`
  ADD PRIMARY KEY (`sequence_value`);

--
-- Indexes for table `sgp_sequence_shipment_0`
--
ALTER TABLE `sgp_sequence_shipment_0`
  ADD PRIMARY KEY (`sequence_value`);

--
-- Indexes for table `sgp_sequence_shipment_1`
--
ALTER TABLE `sgp_sequence_shipment_1`
  ADD PRIMARY KEY (`sequence_value`);

--
-- Indexes for table `sgp_session`
--
ALTER TABLE `sgp_session`
  ADD PRIMARY KEY (`session_id`);

--
-- Indexes for table `sgp_setup_module`
--
ALTER TABLE `sgp_setup_module`
  ADD PRIMARY KEY (`module`);

--
-- Indexes for table `sgp_shipping_tablerate`
--
ALTER TABLE `sgp_shipping_tablerate`
  ADD PRIMARY KEY (`pk`),
  ADD UNIQUE KEY `UNQ_FF110EAABE588D3C3E119B861EE3E6D0` (`website_id`,`dest_country_id`,`dest_region_id`,`dest_zip`,`condition_name`,`condition_value`);

--
-- Indexes for table `sgp_sitemap`
--
ALTER TABLE `sgp_sitemap`
  ADD PRIMARY KEY (`sitemap_id`),
  ADD KEY `SGP_SITEMAP_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_store`
--
ALTER TABLE `sgp_store`
  ADD PRIMARY KEY (`store_id`),
  ADD UNIQUE KEY `SGP_STORE_CODE` (`code`),
  ADD KEY `SGP_STORE_WEBSITE_ID` (`website_id`),
  ADD KEY `SGP_STORE_IS_ACTIVE_SORT_ORDER` (`is_active`,`sort_order`),
  ADD KEY `SGP_STORE_GROUP_ID` (`group_id`);

--
-- Indexes for table `sgp_store_group`
--
ALTER TABLE `sgp_store_group`
  ADD PRIMARY KEY (`group_id`),
  ADD KEY `SGP_STORE_GROUP_WEBSITE_ID` (`website_id`),
  ADD KEY `SGP_STORE_GROUP_DEFAULT_STORE_ID` (`default_store_id`);

--
-- Indexes for table `sgp_store_website`
--
ALTER TABLE `sgp_store_website`
  ADD PRIMARY KEY (`website_id`),
  ADD UNIQUE KEY `SGP_STORE_WEBSITE_CODE` (`code`),
  ADD KEY `SGP_STORE_WEBSITE_SORT_ORDER` (`sort_order`),
  ADD KEY `SGP_STORE_WEBSITE_DEFAULT_GROUP_ID` (`default_group_id`);

--
-- Indexes for table `sgp_tax_calculation`
--
ALTER TABLE `sgp_tax_calculation`
  ADD PRIMARY KEY (`tax_calculation_id`),
  ADD KEY `SGP_TAX_CALCULATION_TAX_CALCULATION_RULE_ID` (`tax_calculation_rule_id`),
  ADD KEY `SGP_TAX_CALCULATION_CUSTOMER_TAX_CLASS_ID` (`customer_tax_class_id`),
  ADD KEY `SGP_TAX_CALCULATION_PRODUCT_TAX_CLASS_ID` (`product_tax_class_id`),
  ADD KEY `SGP_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`);

--
-- Indexes for table `sgp_tax_calculation_rate`
--
ALTER TABLE `sgp_tax_calculation_rate`
  ADD PRIMARY KEY (`tax_calculation_rate_id`),
  ADD KEY `SGP_TAX_CALC_RATE_TAX_COUNTRY_ID_TAX_REGION_ID_TAX_POSTCODE` (`tax_country_id`,`tax_region_id`,`tax_postcode`),
  ADD KEY `SGP_TAX_CALCULATION_RATE_CODE` (`code`),
  ADD KEY `IDX_088512BC05E17D322BBA6B49D9E05EB7` (`tax_calculation_rate_id`,`tax_country_id`,`tax_region_id`,`zip_is_range`,`tax_postcode`);

--
-- Indexes for table `sgp_tax_calculation_rate_title`
--
ALTER TABLE `sgp_tax_calculation_rate_title`
  ADD PRIMARY KEY (`tax_calculation_rate_title_id`),
  ADD KEY `SGP_TAX_CALCULATION_RATE_TITLE_TAX_CALCULATION_RATE_ID_STORE_ID` (`tax_calculation_rate_id`,`store_id`),
  ADD KEY `SGP_TAX_CALCULATION_RATE_TITLE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_tax_calculation_rule`
--
ALTER TABLE `sgp_tax_calculation_rule`
  ADD PRIMARY KEY (`tax_calculation_rule_id`),
  ADD KEY `SGP_TAX_CALCULATION_RULE_PRIORITY_POSITION` (`priority`,`position`),
  ADD KEY `SGP_TAX_CALCULATION_RULE_CODE` (`code`);

--
-- Indexes for table `sgp_tax_class`
--
ALTER TABLE `sgp_tax_class`
  ADD PRIMARY KEY (`class_id`);

--
-- Indexes for table `sgp_tax_order_aggregated_created`
--
ALTER TABLE `sgp_tax_order_aggregated_created`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `IDX_63EE77075050D60C6A478725C956FAFE` (`period`,`store_id`,`code`,`percent`,`order_status`),
  ADD KEY `SGP_TAX_ORDER_AGGREGATED_CREATED_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_tax_order_aggregated_updated`
--
ALTER TABLE `sgp_tax_order_aggregated_updated`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `UNQ_AC71C3CE1FFB24190657ADF1249A81C8` (`period`,`store_id`,`code`,`percent`,`order_status`),
  ADD KEY `SGP_TAX_ORDER_AGGREGATED_UPDATED_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_theme`
--
ALTER TABLE `sgp_theme`
  ADD PRIMARY KEY (`theme_id`);

--
-- Indexes for table `sgp_theme_file`
--
ALTER TABLE `sgp_theme_file`
  ADD PRIMARY KEY (`theme_files_id`),
  ADD KEY `SGP_THEME_FILE_THEME_ID_THEME_THEME_ID` (`theme_id`);

--
-- Indexes for table `sgp_translation`
--
ALTER TABLE `sgp_translation`
  ADD PRIMARY KEY (`key_id`),
  ADD UNIQUE KEY `SGP_TRANSLATION_STORE_ID_LOCALE_CRC_STRING_STRING` (`store_id`,`locale`,`crc_string`,`string`);

--
-- Indexes for table `sgp_ui_bookmark`
--
ALTER TABLE `sgp_ui_bookmark`
  ADD PRIMARY KEY (`bookmark_id`),
  ADD KEY `SGP_UI_BOOKMARK_USER_ID_NAMESPACE_IDENTIFIER` (`user_id`,`namespace`,`identifier`);

--
-- Indexes for table `sgp_url_rewrite`
--
ALTER TABLE `sgp_url_rewrite`
  ADD PRIMARY KEY (`url_rewrite_id`),
  ADD UNIQUE KEY `SGP_URL_REWRITE_REQUEST_PATH_STORE_ID` (`request_path`,`store_id`),
  ADD KEY `SGP_URL_REWRITE_TARGET_PATH` (`target_path`),
  ADD KEY `SGP_URL_REWRITE_STORE_ID_ENTITY_ID` (`store_id`,`entity_id`);

--
-- Indexes for table `sgp_variable`
--
ALTER TABLE `sgp_variable`
  ADD PRIMARY KEY (`variable_id`),
  ADD UNIQUE KEY `SGP_VARIABLE_CODE` (`code`);

--
-- Indexes for table `sgp_variable_value`
--
ALTER TABLE `sgp_variable_value`
  ADD PRIMARY KEY (`value_id`),
  ADD UNIQUE KEY `SGP_VARIABLE_VALUE_VARIABLE_ID_STORE_ID` (`variable_id`,`store_id`),
  ADD KEY `SGP_VARIABLE_VALUE_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_vault_payment_token`
--
ALTER TABLE `sgp_vault_payment_token`
  ADD PRIMARY KEY (`entity_id`),
  ADD UNIQUE KEY `SGP_VAULT_PAYMENT_TOKEN_HASH_UNIQUE_INDEX_PUBLIC_HASH` (`public_hash`),
  ADD UNIQUE KEY `UNQ_D040E5BA24B9EDB35AA9FD7A7FDEB2F2` (`payment_method_code`,`customer_id`,`gateway_token`),
  ADD KEY `SGP_VAULT_PAYMENT_TOKEN_CSTR_ID_SGP_CSTR_ENTT_ENTT_ID` (`customer_id`);

--
-- Indexes for table `sgp_vault_payment_token_order_payment_link`
--
ALTER TABLE `sgp_vault_payment_token_order_payment_link`
  ADD PRIMARY KEY (`order_payment_id`,`payment_token_id`),
  ADD KEY `FK_A42F90DF4FCEFCBBB25F3845780DE120` (`payment_token_id`);

--
-- Indexes for table `sgp_weee_tax`
--
ALTER TABLE `sgp_weee_tax`
  ADD PRIMARY KEY (`value_id`),
  ADD KEY `SGP_WEEE_TAX_WEBSITE_ID` (`website_id`),
  ADD KEY `SGP_WEEE_TAX_ENTITY_ID` (`entity_id`),
  ADD KEY `SGP_WEEE_TAX_COUNTRY` (`country`),
  ADD KEY `SGP_WEEE_TAX_ATTRIBUTE_ID` (`attribute_id`);

--
-- Indexes for table `sgp_widget`
--
ALTER TABLE `sgp_widget`
  ADD PRIMARY KEY (`widget_id`),
  ADD KEY `SGP_WIDGET_WIDGET_CODE` (`widget_code`);

--
-- Indexes for table `sgp_widget_instance`
--
ALTER TABLE `sgp_widget_instance`
  ADD PRIMARY KEY (`instance_id`),
  ADD KEY `SGP_WIDGET_INSTANCE_THEME_ID_THEME_THEME_ID` (`theme_id`);

--
-- Indexes for table `sgp_widget_instance_page`
--
ALTER TABLE `sgp_widget_instance_page`
  ADD PRIMARY KEY (`page_id`),
  ADD KEY `SGP_WIDGET_INSTANCE_PAGE_INSTANCE_ID` (`instance_id`);

--
-- Indexes for table `sgp_widget_instance_page_layout`
--
ALTER TABLE `sgp_widget_instance_page_layout`
  ADD UNIQUE KEY `SGP_WIDGET_INSTANCE_PAGE_LAYOUT_LAYOUT_UPDATE_ID_PAGE_ID` (`layout_update_id`,`page_id`),
  ADD KEY `SGP_WIDGET_INSTANCE_PAGE_LAYOUT_PAGE_ID` (`page_id`);

--
-- Indexes for table `sgp_wishlist`
--
ALTER TABLE `sgp_wishlist`
  ADD PRIMARY KEY (`wishlist_id`),
  ADD UNIQUE KEY `SGP_WISHLIST_CUSTOMER_ID` (`customer_id`),
  ADD KEY `SGP_WISHLIST_SHARED` (`shared`);

--
-- Indexes for table `sgp_wishlist_item`
--
ALTER TABLE `sgp_wishlist_item`
  ADD PRIMARY KEY (`wishlist_item_id`),
  ADD KEY `SGP_WISHLIST_ITEM_WISHLIST_ID` (`wishlist_id`),
  ADD KEY `SGP_WISHLIST_ITEM_PRODUCT_ID` (`product_id`),
  ADD KEY `SGP_WISHLIST_ITEM_STORE_ID` (`store_id`);

--
-- Indexes for table `sgp_wishlist_item_option`
--
ALTER TABLE `sgp_wishlist_item_option`
  ADD PRIMARY KEY (`option_id`),
  ADD KEY `FK_6D0395ED797D12607FBC084E3D0B8C0F` (`wishlist_item_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `sgp_adminnotification_inbox`
--
ALTER TABLE `sgp_adminnotification_inbox`
  MODIFY `notification_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Notification id', AUTO_INCREMENT=92;

--
-- AUTO_INCREMENT for table `sgp_authorization_role`
--
ALTER TABLE `sgp_authorization_role`
  MODIFY `role_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Role ID', AUTO_INCREMENT=17;

--
-- AUTO_INCREMENT for table `sgp_authorization_rule`
--
ALTER TABLE `sgp_authorization_rule`
  MODIFY `rule_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Rule ID', AUTO_INCREMENT=683;

--
-- AUTO_INCREMENT for table `sgp_cataloginventory_stock`
--
ALTER TABLE `sgp_cataloginventory_stock`
  MODIFY `stock_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Stock Id', AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `sgp_cataloginventory_stock_item`
--
ALTER TABLE `sgp_cataloginventory_stock_item`
  MODIFY `item_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Item Id', AUTO_INCREMENT=476;

--
-- AUTO_INCREMENT for table `sgp_catalogrule`
--
ALTER TABLE `sgp_catalogrule`
  MODIFY `rule_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Rule Id';

--
-- AUTO_INCREMENT for table `sgp_catalogrule_product`
--
ALTER TABLE `sgp_catalogrule_product`
  MODIFY `rule_product_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Rule Product Id';

--
-- AUTO_INCREMENT for table `sgp_catalogrule_product_price`
--
ALTER TABLE `sgp_catalogrule_product_price`
  MODIFY `rule_product_price_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Rule Product PriceId';

--
-- AUTO_INCREMENT for table `sgp_catalog_category_entity`
--
ALTER TABLE `sgp_catalog_category_entity`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity ID', AUTO_INCREMENT=107;

--
-- AUTO_INCREMENT for table `sgp_catalog_category_entity_datetime`
--
ALTER TABLE `sgp_catalog_category_entity_datetime`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID', AUTO_INCREMENT=65;

--
-- AUTO_INCREMENT for table `sgp_catalog_category_entity_decimal`
--
ALTER TABLE `sgp_catalog_category_entity_decimal`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_category_entity_int`
--
ALTER TABLE `sgp_catalog_category_entity_int`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID', AUTO_INCREMENT=932;

--
-- AUTO_INCREMENT for table `sgp_catalog_category_entity_text`
--
ALTER TABLE `sgp_catalog_category_entity_text`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID', AUTO_INCREMENT=258;

--
-- AUTO_INCREMENT for table `sgp_catalog_category_entity_varchar`
--
ALTER TABLE `sgp_catalog_category_entity_varchar`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID', AUTO_INCREMENT=872;

--
-- AUTO_INCREMENT for table `sgp_catalog_category_product`
--
ALTER TABLE `sgp_catalog_category_product`
  MODIFY `entity_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Entity ID', AUTO_INCREMENT=555;

--
-- AUTO_INCREMENT for table `sgp_catalog_compare_item`
--
ALTER TABLE `sgp_catalog_compare_item`
  MODIFY `catalog_compare_item_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Compare Item ID', AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_bundle_option`
--
ALTER TABLE `sgp_catalog_product_bundle_option`
  MODIFY `option_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Option Id', AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_bundle_option_value`
--
ALTER TABLE `sgp_catalog_product_bundle_option_value`
  MODIFY `value_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Value Id', AUTO_INCREMENT=25;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_bundle_selection`
--
ALTER TABLE `sgp_catalog_product_bundle_selection`
  MODIFY `selection_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Selection Id', AUTO_INCREMENT=115;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_entity`
--
ALTER TABLE `sgp_catalog_product_entity`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity ID', AUTO_INCREMENT=483;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_entity_datetime`
--
ALTER TABLE `sgp_catalog_product_entity_datetime`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID', AUTO_INCREMENT=2307;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_entity_decimal`
--
ALTER TABLE `sgp_catalog_product_entity_decimal`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID', AUTO_INCREMENT=2082;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_entity_gallery`
--
ALTER TABLE `sgp_catalog_product_entity_gallery`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_entity_int`
--
ALTER TABLE `sgp_catalog_product_entity_int`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID', AUTO_INCREMENT=2848;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_entity_media_gallery`
--
ALTER TABLE `sgp_catalog_product_entity_media_gallery`
  MODIFY `value_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Value ID', AUTO_INCREMENT=690;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_entity_media_gallery_value`
--
ALTER TABLE `sgp_catalog_product_entity_media_gallery_value`
  MODIFY `record_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Record Id', AUTO_INCREMENT=2108;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_entity_text`
--
ALTER TABLE `sgp_catalog_product_entity_text`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID', AUTO_INCREMENT=3134;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_entity_tier_price`
--
ALTER TABLE `sgp_catalog_product_entity_tier_price`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_entity_varchar`
--
ALTER TABLE `sgp_catalog_product_entity_varchar`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID', AUTO_INCREMENT=15555;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_link`
--
ALTER TABLE `sgp_catalog_product_link`
  MODIFY `link_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Link ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_link_attribute`
--
ALTER TABLE `sgp_catalog_product_link_attribute`
  MODIFY `product_link_attribute_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Product Link Attribute ID', AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_link_attribute_decimal`
--
ALTER TABLE `sgp_catalog_product_link_attribute_decimal`
  MODIFY `value_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Value ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_link_attribute_int`
--
ALTER TABLE `sgp_catalog_product_link_attribute_int`
  MODIFY `value_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Value ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_link_attribute_varchar`
--
ALTER TABLE `sgp_catalog_product_link_attribute_varchar`
  MODIFY `value_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Value ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_link_type`
--
ALTER TABLE `sgp_catalog_product_link_type`
  MODIFY `link_type_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Link Type ID', AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `sgp_catalog_product_option`
--
ALTER TABLE `sgp_catalog_product_option`
  MODIFY `option_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Option ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_option_price`
--
ALTER TABLE `sgp_catalog_product_option_price`
  MODIFY `option_price_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Option Price ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_option_title`
--
ALTER TABLE `sgp_catalog_product_option_title`
  MODIFY `option_title_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Option Title ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_option_type_price`
--
ALTER TABLE `sgp_catalog_product_option_type_price`
  MODIFY `option_type_price_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Option Type Price ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_option_type_title`
--
ALTER TABLE `sgp_catalog_product_option_type_title`
  MODIFY `option_type_title_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Option Type Title ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_option_type_value`
--
ALTER TABLE `sgp_catalog_product_option_type_value`
  MODIFY `option_type_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Option Type ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_super_attribute`
--
ALTER TABLE `sgp_catalog_product_super_attribute`
  MODIFY `product_super_attribute_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Product Super Attribute ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_super_attribute_label`
--
ALTER TABLE `sgp_catalog_product_super_attribute_label`
  MODIFY `value_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Value ID';

--
-- AUTO_INCREMENT for table `sgp_catalog_product_super_link`
--
ALTER TABLE `sgp_catalog_product_super_link`
  MODIFY `link_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Link ID';

--
-- AUTO_INCREMENT for table `sgp_checkout_agreement`
--
ALTER TABLE `sgp_checkout_agreement`
  MODIFY `agreement_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Agreement Id';

--
-- AUTO_INCREMENT for table `sgp_cms_block`
--
ALTER TABLE `sgp_cms_block`
  MODIFY `block_id` smallint(6) NOT NULL AUTO_INCREMENT COMMENT 'Block ID', AUTO_INCREMENT=89;

--
-- AUTO_INCREMENT for table `sgp_cms_page`
--
ALTER TABLE `sgp_cms_page`
  MODIFY `page_id` smallint(6) NOT NULL AUTO_INCREMENT COMMENT 'Page ID', AUTO_INCREMENT=27;

--
-- AUTO_INCREMENT for table `sgp_core_config_data`
--
ALTER TABLE `sgp_core_config_data`
  MODIFY `config_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Config Id', AUTO_INCREMENT=566;

--
-- AUTO_INCREMENT for table `sgp_cron_schedule`
--
ALTER TABLE `sgp_cron_schedule`
  MODIFY `schedule_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Schedule Id';

--
-- AUTO_INCREMENT for table `sgp_customer_address_entity`
--
ALTER TABLE `sgp_customer_address_entity`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id', AUTO_INCREMENT=177;

--
-- AUTO_INCREMENT for table `sgp_customer_address_entity_datetime`
--
ALTER TABLE `sgp_customer_address_entity_datetime`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_customer_address_entity_decimal`
--
ALTER TABLE `sgp_customer_address_entity_decimal`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_customer_address_entity_int`
--
ALTER TABLE `sgp_customer_address_entity_int`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_customer_address_entity_text`
--
ALTER TABLE `sgp_customer_address_entity_text`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_customer_address_entity_varchar`
--
ALTER TABLE `sgp_customer_address_entity_varchar`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_customer_entity_datetime`
--
ALTER TABLE `sgp_customer_entity_datetime`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_customer_entity_decimal`
--
ALTER TABLE `sgp_customer_entity_decimal`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_customer_entity_int`
--
ALTER TABLE `sgp_customer_entity_int`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_customer_entity_text`
--
ALTER TABLE `sgp_customer_entity_text`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_customer_entity_varchar`
--
ALTER TABLE `sgp_customer_entity_varchar`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_customer_group`
--
ALTER TABLE `sgp_customer_group`
  MODIFY `customer_group_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Customer Group Id', AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `sgp_customer_log`
--
ALTER TABLE `sgp_customer_log`
  MODIFY `log_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Log ID', AUTO_INCREMENT=2463;

--
-- AUTO_INCREMENT for table `sgp_customer_visitor`
--
ALTER TABLE `sgp_customer_visitor`
  MODIFY `visitor_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Visitor ID';

--
-- AUTO_INCREMENT for table `sgp_design_change`
--
ALTER TABLE `sgp_design_change`
  MODIFY `design_change_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Design Change Id';

--
-- AUTO_INCREMENT for table `sgp_directory_country_format`
--
ALTER TABLE `sgp_directory_country_format`
  MODIFY `country_format_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Country Format Id';

--
-- AUTO_INCREMENT for table `sgp_directory_country_region`
--
ALTER TABLE `sgp_directory_country_region`
  MODIFY `region_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Region Id', AUTO_INCREMENT=512;

--
-- AUTO_INCREMENT for table `sgp_downloadable_link`
--
ALTER TABLE `sgp_downloadable_link`
  MODIFY `link_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Link ID';

--
-- AUTO_INCREMENT for table `sgp_downloadable_link_price`
--
ALTER TABLE `sgp_downloadable_link_price`
  MODIFY `price_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Price ID';

--
-- AUTO_INCREMENT for table `sgp_downloadable_link_purchased`
--
ALTER TABLE `sgp_downloadable_link_purchased`
  MODIFY `purchased_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Purchased ID';

--
-- AUTO_INCREMENT for table `sgp_downloadable_link_purchased_item`
--
ALTER TABLE `sgp_downloadable_link_purchased_item`
  MODIFY `item_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Item ID';

--
-- AUTO_INCREMENT for table `sgp_downloadable_link_title`
--
ALTER TABLE `sgp_downloadable_link_title`
  MODIFY `title_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Title ID';

--
-- AUTO_INCREMENT for table `sgp_downloadable_sample`
--
ALTER TABLE `sgp_downloadable_sample`
  MODIFY `sample_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Sample ID';

--
-- AUTO_INCREMENT for table `sgp_downloadable_sample_title`
--
ALTER TABLE `sgp_downloadable_sample_title`
  MODIFY `title_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Title ID';

--
-- AUTO_INCREMENT for table `sgp_eav_attribute`
--
ALTER TABLE `sgp_eav_attribute`
  MODIFY `attribute_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Attribute Id', AUTO_INCREMENT=153;

--
-- AUTO_INCREMENT for table `sgp_eav_attribute_group`
--
ALTER TABLE `sgp_eav_attribute_group`
  MODIFY `attribute_group_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Attribute Group Id', AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `sgp_eav_attribute_label`
--
ALTER TABLE `sgp_eav_attribute_label`
  MODIFY `attribute_label_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Attribute Label Id', AUTO_INCREMENT=53;

--
-- AUTO_INCREMENT for table `sgp_eav_attribute_option`
--
ALTER TABLE `sgp_eav_attribute_option`
  MODIFY `option_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Option Id', AUTO_INCREMENT=30;

--
-- AUTO_INCREMENT for table `sgp_eav_attribute_option_swatch`
--
ALTER TABLE `sgp_eav_attribute_option_swatch`
  MODIFY `swatch_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Swatch ID';

--
-- AUTO_INCREMENT for table `sgp_eav_attribute_option_value`
--
ALTER TABLE `sgp_eav_attribute_option_value`
  MODIFY `value_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Value Id', AUTO_INCREMENT=39;

--
-- AUTO_INCREMENT for table `sgp_eav_attribute_set`
--
ALTER TABLE `sgp_eav_attribute_set`
  MODIFY `attribute_set_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Attribute Set Id', AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `sgp_eav_entity`
--
ALTER TABLE `sgp_eav_entity`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_eav_entity_attribute`
--
ALTER TABLE `sgp_eav_entity_attribute`
  MODIFY `entity_attribute_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Attribute Id', AUTO_INCREMENT=668;

--
-- AUTO_INCREMENT for table `sgp_eav_entity_datetime`
--
ALTER TABLE `sgp_eav_entity_datetime`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_eav_entity_decimal`
--
ALTER TABLE `sgp_eav_entity_decimal`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_eav_entity_int`
--
ALTER TABLE `sgp_eav_entity_int`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_eav_entity_store`
--
ALTER TABLE `sgp_eav_entity_store`
  MODIFY `entity_store_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Store Id';

--
-- AUTO_INCREMENT for table `sgp_eav_entity_text`
--
ALTER TABLE `sgp_eav_entity_text`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_eav_entity_type`
--
ALTER TABLE `sgp_eav_entity_type`
  MODIFY `entity_type_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Type Id', AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `sgp_eav_entity_varchar`
--
ALTER TABLE `sgp_eav_entity_varchar`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_eav_form_element`
--
ALTER TABLE `sgp_eav_form_element`
  MODIFY `element_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Element Id', AUTO_INCREMENT=43;

--
-- AUTO_INCREMENT for table `sgp_eav_form_fieldset`
--
ALTER TABLE `sgp_eav_form_fieldset`
  MODIFY `fieldset_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Fieldset Id';

--
-- AUTO_INCREMENT for table `sgp_eav_form_type`
--
ALTER TABLE `sgp_eav_form_type`
  MODIFY `type_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Type Id', AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `sgp_email_template`
--
ALTER TABLE `sgp_email_template`
  MODIFY `template_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Template ID';

--
-- AUTO_INCREMENT for table `sgp_flag`
--
ALTER TABLE `sgp_flag`
  MODIFY `flag_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Flag Id', AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `sgp_gift_message`
--
ALTER TABLE `sgp_gift_message`
  MODIFY `gift_message_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'GiftMessage Id';

--
-- AUTO_INCREMENT for table `sgp_googleoptimizer_code`
--
ALTER TABLE `sgp_googleoptimizer_code`
  MODIFY `code_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Google experiment code id';

--
-- AUTO_INCREMENT for table `sgp_hozmegamenu`
--
ALTER TABLE `sgp_hozmegamenu`
  MODIFY `hozmegamenu_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'hozmegamenu ID', AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `sgp_importexport_importdata`
--
ALTER TABLE `sgp_importexport_importdata`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id';

--
-- AUTO_INCREMENT for table `sgp_import_history`
--
ALTER TABLE `sgp_import_history`
  MODIFY `history_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'History record Id';

--
-- AUTO_INCREMENT for table `sgp_indexer_state`
--
ALTER TABLE `sgp_indexer_state`
  MODIFY `state_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Indexer State Id', AUTO_INCREMENT=11;

--
-- AUTO_INCREMENT for table `sgp_integration`
--
ALTER TABLE `sgp_integration`
  MODIFY `integration_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Integration ID';

--
-- AUTO_INCREMENT for table `sgp_layout_link`
--
ALTER TABLE `sgp_layout_link`
  MODIFY `layout_link_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Link Id';

--
-- AUTO_INCREMENT for table `sgp_layout_update`
--
ALTER TABLE `sgp_layout_update`
  MODIFY `layout_update_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Layout Update Id';

--
-- AUTO_INCREMENT for table `sgp_mview_state`
--
ALTER TABLE `sgp_mview_state`
  MODIFY `state_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'View State Id';

--
-- AUTO_INCREMENT for table `sgp_newsletter_problem`
--
ALTER TABLE `sgp_newsletter_problem`
  MODIFY `problem_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Problem Id';

--
-- AUTO_INCREMENT for table `sgp_newsletter_queue`
--
ALTER TABLE `sgp_newsletter_queue`
  MODIFY `queue_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Queue Id';

--
-- AUTO_INCREMENT for table `sgp_newsletter_queue_link`
--
ALTER TABLE `sgp_newsletter_queue_link`
  MODIFY `queue_link_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Queue Link Id';

--
-- AUTO_INCREMENT for table `sgp_newsletter_template`
--
ALTER TABLE `sgp_newsletter_template`
  MODIFY `template_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Template ID';

--
-- AUTO_INCREMENT for table `sgp_oauth_consumer`
--
ALTER TABLE `sgp_oauth_consumer`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_oauth_token`
--
ALTER TABLE `sgp_oauth_token`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity ID';

--
-- AUTO_INCREMENT for table `sgp_oauth_token_request_log`
--
ALTER TABLE `sgp_oauth_token_request_log`
  MODIFY `log_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Log Id';

--
-- AUTO_INCREMENT for table `sgp_password_reset_request_event`
--
ALTER TABLE `sgp_password_reset_request_event`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity ID', AUTO_INCREMENT=238;

--
-- AUTO_INCREMENT for table `sgp_paypal_billing_agreement`
--
ALTER TABLE `sgp_paypal_billing_agreement`
  MODIFY `agreement_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Agreement Id';

--
-- AUTO_INCREMENT for table `sgp_paypal_cert`
--
ALTER TABLE `sgp_paypal_cert`
  MODIFY `cert_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Cert Id';

--
-- AUTO_INCREMENT for table `sgp_paypal_payment_transaction`
--
ALTER TABLE `sgp_paypal_payment_transaction`
  MODIFY `transaction_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_paypal_settlement_report`
--
ALTER TABLE `sgp_paypal_settlement_report`
  MODIFY `report_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Report Id';

--
-- AUTO_INCREMENT for table `sgp_paypal_settlement_report_row`
--
ALTER TABLE `sgp_paypal_settlement_report_row`
  MODIFY `row_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Row Id';

--
-- AUTO_INCREMENT for table `sgp_persistent_session`
--
ALTER TABLE `sgp_persistent_session`
  MODIFY `persistent_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Session id';

--
-- AUTO_INCREMENT for table `sgp_plazathemes_blog_category`
--
ALTER TABLE `sgp_plazathemes_blog_category`
  MODIFY `category_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Category ID', AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `sgp_plazathemes_blog_post`
--
ALTER TABLE `sgp_plazathemes_blog_post`
  MODIFY `post_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Post ID', AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `sgp_product_alert_price`
--
ALTER TABLE `sgp_product_alert_price`
  MODIFY `alert_price_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Product alert price id';

--
-- AUTO_INCREMENT for table `sgp_product_alert_stock`
--
ALTER TABLE `sgp_product_alert_stock`
  MODIFY `alert_stock_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Product alert stock id';

--
-- AUTO_INCREMENT for table `sgp_pt_bannerslider`
--
ALTER TABLE `sgp_pt_bannerslider`
  MODIFY `banner_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Banner ID', AUTO_INCREMENT=24;

--
-- AUTO_INCREMENT for table `sgp_pt_brandslider`
--
ALTER TABLE `sgp_pt_brandslider`
  MODIFY `brand_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Brand ID', AUTO_INCREMENT=22;

--
-- AUTO_INCREMENT for table `sgp_pt_testimonial`
--
ALTER TABLE `sgp_pt_testimonial`
  MODIFY `testimo_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Testimonial ID';

--
-- AUTO_INCREMENT for table `sgp_quote_address`
--
ALTER TABLE `sgp_quote_address`
  MODIFY `address_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Address Id', AUTO_INCREMENT=6205;

--
-- AUTO_INCREMENT for table `sgp_quote_address_item`
--
ALTER TABLE `sgp_quote_address_item`
  MODIFY `address_item_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Address Item Id';

--
-- AUTO_INCREMENT for table `sgp_quote_id_mask`
--
ALTER TABLE `sgp_quote_id_mask`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id', AUTO_INCREMENT=703;

--
-- AUTO_INCREMENT for table `sgp_quote_item`
--
ALTER TABLE `sgp_quote_item`
  MODIFY `item_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Item Id', AUTO_INCREMENT=198;

--
-- AUTO_INCREMENT for table `sgp_quote_item_option`
--
ALTER TABLE `sgp_quote_item_option`
  MODIFY `option_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Option Id', AUTO_INCREMENT=378;

--
-- AUTO_INCREMENT for table `sgp_quote_shipping_rate`
--
ALTER TABLE `sgp_quote_shipping_rate`
  MODIFY `rate_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Rate Id', AUTO_INCREMENT=1732;

--
-- AUTO_INCREMENT for table `sgp_rating`
--
ALTER TABLE `sgp_rating`
  MODIFY `rating_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Rating Id', AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `sgp_rating_entity`
--
ALTER TABLE `sgp_rating_entity`
  MODIFY `entity_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id', AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `sgp_rating_option`
--
ALTER TABLE `sgp_rating_option`
  MODIFY `option_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Rating Option Id', AUTO_INCREMENT=16;

--
-- AUTO_INCREMENT for table `sgp_rating_option_vote`
--
ALTER TABLE `sgp_rating_option_vote`
  MODIFY `vote_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Vote id';

--
-- AUTO_INCREMENT for table `sgp_rating_option_vote_aggregated`
--
ALTER TABLE `sgp_rating_option_vote_aggregated`
  MODIFY `primary_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Vote aggregation id';

--
-- AUTO_INCREMENT for table `sgp_reporting_counts`
--
ALTER TABLE `sgp_reporting_counts`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_reporting_module_status`
--
ALTER TABLE `sgp_reporting_module_status`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Module Id';

--
-- AUTO_INCREMENT for table `sgp_reporting_orders`
--
ALTER TABLE `sgp_reporting_orders`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_reporting_system_updates`
--
ALTER TABLE `sgp_reporting_system_updates`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_reporting_users`
--
ALTER TABLE `sgp_reporting_users`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_report_compared_product_index`
--
ALTER TABLE `sgp_report_compared_product_index`
  MODIFY `index_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Index Id', AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `sgp_report_event`
--
ALTER TABLE `sgp_report_event`
  MODIFY `event_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Event Id', AUTO_INCREMENT=64887;

--
-- AUTO_INCREMENT for table `sgp_report_event_types`
--
ALTER TABLE `sgp_report_event_types`
  MODIFY `event_type_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Event Type Id', AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `sgp_report_viewed_product_aggregated_daily`
--
ALTER TABLE `sgp_report_viewed_product_aggregated_daily`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', AUTO_INCREMENT=20;

--
-- AUTO_INCREMENT for table `sgp_report_viewed_product_aggregated_monthly`
--
ALTER TABLE `sgp_report_viewed_product_aggregated_monthly`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `sgp_report_viewed_product_aggregated_yearly`
--
ALTER TABLE `sgp_report_viewed_product_aggregated_yearly`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', AUTO_INCREMENT=14;

--
-- AUTO_INCREMENT for table `sgp_report_viewed_product_index`
--
ALTER TABLE `sgp_report_viewed_product_index`
  MODIFY `index_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Index Id', AUTO_INCREMENT=62762;

--
-- AUTO_INCREMENT for table `sgp_review`
--
ALTER TABLE `sgp_review`
  MODIFY `review_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Review id';

--
-- AUTO_INCREMENT for table `sgp_review_detail`
--
ALTER TABLE `sgp_review_detail`
  MODIFY `detail_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Review detail id';

--
-- AUTO_INCREMENT for table `sgp_review_entity`
--
ALTER TABLE `sgp_review_entity`
  MODIFY `entity_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Review entity id', AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `sgp_review_entity_summary`
--
ALTER TABLE `sgp_review_entity_summary`
  MODIFY `primary_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'Summary review entity id';

--
-- AUTO_INCREMENT for table `sgp_review_status`
--
ALTER TABLE `sgp_review_status`
  MODIFY `status_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Status id', AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `sgp_salesrule`
--
ALTER TABLE `sgp_salesrule`
  MODIFY `rule_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Rule Id';

--
-- AUTO_INCREMENT for table `sgp_salesrule_coupon`
--
ALTER TABLE `sgp_salesrule_coupon`
  MODIFY `coupon_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Coupon Id';

--
-- AUTO_INCREMENT for table `sgp_salesrule_coupon_aggregated`
--
ALTER TABLE `sgp_salesrule_coupon_aggregated`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id';

--
-- AUTO_INCREMENT for table `sgp_salesrule_coupon_aggregated_order`
--
ALTER TABLE `sgp_salesrule_coupon_aggregated_order`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id';

--
-- AUTO_INCREMENT for table `sgp_salesrule_coupon_aggregated_updated`
--
ALTER TABLE `sgp_salesrule_coupon_aggregated_updated`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id';

--
-- AUTO_INCREMENT for table `sgp_salesrule_customer`
--
ALTER TABLE `sgp_salesrule_customer`
  MODIFY `rule_customer_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Rule Customer Id';

--
-- AUTO_INCREMENT for table `sgp_salesrule_label`
--
ALTER TABLE `sgp_salesrule_label`
  MODIFY `label_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Label Id';

--
-- AUTO_INCREMENT for table `sgp_sales_bestsellers_aggregated_daily`
--
ALTER TABLE `sgp_sales_bestsellers_aggregated_daily`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', AUTO_INCREMENT=858;

--
-- AUTO_INCREMENT for table `sgp_sales_bestsellers_aggregated_monthly`
--
ALTER TABLE `sgp_sales_bestsellers_aggregated_monthly`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', AUTO_INCREMENT=573;

--
-- AUTO_INCREMENT for table `sgp_sales_bestsellers_aggregated_yearly`
--
ALTER TABLE `sgp_sales_bestsellers_aggregated_yearly`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', AUTO_INCREMENT=375;

--
-- AUTO_INCREMENT for table `sgp_sales_creditmemo`
--
ALTER TABLE `sgp_sales_creditmemo`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_sales_creditmemo_comment`
--
ALTER TABLE `sgp_sales_creditmemo_comment`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_sales_creditmemo_item`
--
ALTER TABLE `sgp_sales_creditmemo_item`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_sales_invoice`
--
ALTER TABLE `sgp_sales_invoice`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_sales_invoiced_aggregated`
--
ALTER TABLE `sgp_sales_invoiced_aggregated`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id';

--
-- AUTO_INCREMENT for table `sgp_sales_invoiced_aggregated_order`
--
ALTER TABLE `sgp_sales_invoiced_aggregated_order`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id';

--
-- AUTO_INCREMENT for table `sgp_sales_invoice_comment`
--
ALTER TABLE `sgp_sales_invoice_comment`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_sales_invoice_item`
--
ALTER TABLE `sgp_sales_invoice_item`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_sales_order_address`
--
ALTER TABLE `sgp_sales_order_address`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id', AUTO_INCREMENT=883;

--
-- AUTO_INCREMENT for table `sgp_sales_order_aggregated_created`
--
ALTER TABLE `sgp_sales_order_aggregated_created`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', AUTO_INCREMENT=813;

--
-- AUTO_INCREMENT for table `sgp_sales_order_aggregated_updated`
--
ALTER TABLE `sgp_sales_order_aggregated_updated`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', AUTO_INCREMENT=813;

--
-- AUTO_INCREMENT for table `sgp_sales_order_item`
--
ALTER TABLE `sgp_sales_order_item`
  MODIFY `item_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Item Id', AUTO_INCREMENT=1340;

--
-- AUTO_INCREMENT for table `sgp_sales_order_status_history`
--
ALTER TABLE `sgp_sales_order_status_history`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id', AUTO_INCREMENT=845;

--
-- AUTO_INCREMENT for table `sgp_sales_order_tax`
--
ALTER TABLE `sgp_sales_order_tax`
  MODIFY `tax_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Tax Id';

--
-- AUTO_INCREMENT for table `sgp_sales_order_tax_item`
--
ALTER TABLE `sgp_sales_order_tax_item`
  MODIFY `tax_item_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Tax Item Id';

--
-- AUTO_INCREMENT for table `sgp_sales_payment_transaction`
--
ALTER TABLE `sgp_sales_payment_transaction`
  MODIFY `transaction_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Transaction Id', AUTO_INCREMENT=349;

--
-- AUTO_INCREMENT for table `sgp_sales_refunded_aggregated`
--
ALTER TABLE `sgp_sales_refunded_aggregated`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id';

--
-- AUTO_INCREMENT for table `sgp_sales_refunded_aggregated_order`
--
ALTER TABLE `sgp_sales_refunded_aggregated_order`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id';

--
-- AUTO_INCREMENT for table `sgp_sales_sequence_meta`
--
ALTER TABLE `sgp_sales_sequence_meta`
  MODIFY `meta_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `sgp_sales_sequence_profile`
--
ALTER TABLE `sgp_sales_sequence_profile`
  MODIFY `profile_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', AUTO_INCREMENT=9;

--
-- AUTO_INCREMENT for table `sgp_sales_shipment`
--
ALTER TABLE `sgp_sales_shipment`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_sales_shipment_comment`
--
ALTER TABLE `sgp_sales_shipment_comment`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_sales_shipment_item`
--
ALTER TABLE `sgp_sales_shipment_item`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_sales_shipment_track`
--
ALTER TABLE `sgp_sales_shipment_track`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_sales_shipping_aggregated`
--
ALTER TABLE `sgp_sales_shipping_aggregated`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id';

--
-- AUTO_INCREMENT for table `sgp_sales_shipping_aggregated_order`
--
ALTER TABLE `sgp_sales_shipping_aggregated_order`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id', AUTO_INCREMENT=813;

--
-- AUTO_INCREMENT for table `sgp_search_query`
--
ALTER TABLE `sgp_search_query`
  MODIFY `query_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Query ID', AUTO_INCREMENT=9409;

--
-- AUTO_INCREMENT for table `sgp_search_synonyms`
--
ALTER TABLE `sgp_search_synonyms`
  MODIFY `group_id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Synonyms Group Id';

--
-- AUTO_INCREMENT for table `sgp_sendfriend_log`
--
ALTER TABLE `sgp_sendfriend_log`
  MODIFY `log_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Log ID';

--
-- AUTO_INCREMENT for table `sgp_sequence_creditmemo_0`
--
ALTER TABLE `sgp_sequence_creditmemo_0`
  MODIFY `sequence_value` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sgp_sequence_creditmemo_1`
--
ALTER TABLE `sgp_sequence_creditmemo_1`
  MODIFY `sequence_value` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sgp_sequence_invoice_0`
--
ALTER TABLE `sgp_sequence_invoice_0`
  MODIFY `sequence_value` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sgp_sequence_invoice_1`
--
ALTER TABLE `sgp_sequence_invoice_1`
  MODIFY `sequence_value` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sgp_sequence_order_0`
--
ALTER TABLE `sgp_sequence_order_0`
  MODIFY `sequence_value` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sgp_sequence_order_1`
--
ALTER TABLE `sgp_sequence_order_1`
  MODIFY `sequence_value` int(10) UNSIGNED NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=515;

--
-- AUTO_INCREMENT for table `sgp_sequence_shipment_0`
--
ALTER TABLE `sgp_sequence_shipment_0`
  MODIFY `sequence_value` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sgp_sequence_shipment_1`
--
ALTER TABLE `sgp_sequence_shipment_1`
  MODIFY `sequence_value` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sgp_shipping_tablerate`
--
ALTER TABLE `sgp_shipping_tablerate`
  MODIFY `pk` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Primary key';

--
-- AUTO_INCREMENT for table `sgp_sitemap`
--
ALTER TABLE `sgp_sitemap`
  MODIFY `sitemap_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Sitemap Id';

--
-- AUTO_INCREMENT for table `sgp_store`
--
ALTER TABLE `sgp_store`
  MODIFY `store_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Store Id', AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `sgp_store_group`
--
ALTER TABLE `sgp_store_group`
  MODIFY `group_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Group Id', AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `sgp_store_website`
--
ALTER TABLE `sgp_store_website`
  MODIFY `website_id` smallint(5) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Website Id', AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `sgp_tax_calculation`
--
ALTER TABLE `sgp_tax_calculation`
  MODIFY `tax_calculation_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Tax Calculation Id';

--
-- AUTO_INCREMENT for table `sgp_tax_calculation_rate`
--
ALTER TABLE `sgp_tax_calculation_rate`
  MODIFY `tax_calculation_rate_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Tax Calculation Rate Id', AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `sgp_tax_calculation_rate_title`
--
ALTER TABLE `sgp_tax_calculation_rate_title`
  MODIFY `tax_calculation_rate_title_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Tax Calculation Rate Title Id';

--
-- AUTO_INCREMENT for table `sgp_tax_calculation_rule`
--
ALTER TABLE `sgp_tax_calculation_rule`
  MODIFY `tax_calculation_rule_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Tax Calculation Rule Id';

--
-- AUTO_INCREMENT for table `sgp_tax_class`
--
ALTER TABLE `sgp_tax_class`
  MODIFY `class_id` smallint(6) NOT NULL AUTO_INCREMENT COMMENT 'Class Id', AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `sgp_tax_order_aggregated_created`
--
ALTER TABLE `sgp_tax_order_aggregated_created`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id';

--
-- AUTO_INCREMENT for table `sgp_tax_order_aggregated_updated`
--
ALTER TABLE `sgp_tax_order_aggregated_updated`
  MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Id';

--
-- AUTO_INCREMENT for table `sgp_theme`
--
ALTER TABLE `sgp_theme`
  MODIFY `theme_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Theme identifier', AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `sgp_theme_file`
--
ALTER TABLE `sgp_theme_file`
  MODIFY `theme_files_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Theme files identifier';

--
-- AUTO_INCREMENT for table `sgp_translation`
--
ALTER TABLE `sgp_translation`
  MODIFY `key_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Key Id of Translation';

--
-- AUTO_INCREMENT for table `sgp_ui_bookmark`
--
ALTER TABLE `sgp_ui_bookmark`
  MODIFY `bookmark_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Bookmark identifier', AUTO_INCREMENT=45;

--
-- AUTO_INCREMENT for table `sgp_url_rewrite`
--
ALTER TABLE `sgp_url_rewrite`
  MODIFY `url_rewrite_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Rewrite Id', AUTO_INCREMENT=3372;

--
-- AUTO_INCREMENT for table `sgp_variable`
--
ALTER TABLE `sgp_variable`
  MODIFY `variable_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Variable Id';

--
-- AUTO_INCREMENT for table `sgp_variable_value`
--
ALTER TABLE `sgp_variable_value`
  MODIFY `value_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Variable Value Id';

--
-- AUTO_INCREMENT for table `sgp_vault_payment_token`
--
ALTER TABLE `sgp_vault_payment_token`
  MODIFY `entity_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Entity Id';

--
-- AUTO_INCREMENT for table `sgp_weee_tax`
--
ALTER TABLE `sgp_weee_tax`
  MODIFY `value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value Id';

--
-- AUTO_INCREMENT for table `sgp_widget`
--
ALTER TABLE `sgp_widget`
  MODIFY `widget_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Widget Id';

--
-- AUTO_INCREMENT for table `sgp_widget_instance`
--
ALTER TABLE `sgp_widget_instance`
  MODIFY `instance_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Instance Id';

--
-- AUTO_INCREMENT for table `sgp_widget_instance_page`
--
ALTER TABLE `sgp_widget_instance_page`
  MODIFY `page_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Page Id';

--
-- AUTO_INCREMENT for table `sgp_wishlist`
--
ALTER TABLE `sgp_wishlist`
  MODIFY `wishlist_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Wishlist ID', AUTO_INCREMENT=2075;

--
-- AUTO_INCREMENT for table `sgp_wishlist_item`
--
ALTER TABLE `sgp_wishlist_item`
  MODIFY `wishlist_item_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Wishlist item ID';

--
-- AUTO_INCREMENT for table `sgp_wishlist_item_option`
--
ALTER TABLE `sgp_wishlist_item_option`
  MODIFY `option_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Option Id';

--
-- Constraints for table `sgp_authorization_rule`
--
ALTER TABLE `sgp_authorization_rule`
  ADD CONSTRAINT `SGP_AUTHORIZATION_RULE_ROLE_ID_AUTHORIZATION_ROLE_ROLE_ID` FOREIGN KEY (`role_id`) REFERENCES `sgp_authorization_role` (`role_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_cataloginventory_stock_item`
--
ALTER TABLE `sgp_cataloginventory_stock_item`
  ADD CONSTRAINT `SGP_CATINV_STOCK_ITEM_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CATINV_STOCK_ITEM_STOCK_ID_CATINV_STOCK_STOCK_ID` FOREIGN KEY (`stock_id`) REFERENCES `sgp_cataloginventory_stock` (`stock_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalogrule_customer_group`
--
ALTER TABLE `sgp_catalogrule_customer_group`
  ADD CONSTRAINT `SGP_CATALOGRULE_CUSTOMER_GROUP_RULE_ID_CATALOGRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `sgp_catalogrule` (`rule_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CATRULE_CSTR_GROUP_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID` FOREIGN KEY (`customer_group_id`) REFERENCES `sgp_customer_group` (`customer_group_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalogrule_group_website`
--
ALTER TABLE `sgp_catalogrule_group_website`
  ADD CONSTRAINT `SGP_CATALOGRULE_GROUP_WEBSITE_RULE_ID_CATALOGRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `sgp_catalogrule` (`rule_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CATRULE_GROUP_WS_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID` FOREIGN KEY (`customer_group_id`) REFERENCES `sgp_customer_group` (`customer_group_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CATRULE_GROUP_WS_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalogrule_website`
--
ALTER TABLE `sgp_catalogrule_website`
  ADD CONSTRAINT `SGP_CATALOGRULE_WEBSITE_RULE_ID_CATALOGRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `sgp_catalogrule` (`rule_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CATALOGRULE_WEBSITE_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_category_entity_datetime`
--
ALTER TABLE `sgp_catalog_category_entity_datetime`
  ADD CONSTRAINT `SGP_CATALOG_CATEGORY_ENTITY_DATETIME_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_CTGR_ENTT_DTIME_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_CTGR_ENTT_DTIME_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_category_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_category_entity_decimal`
--
ALTER TABLE `sgp_catalog_category_entity_decimal`
  ADD CONSTRAINT `SGP_CATALOG_CATEGORY_ENTITY_DECIMAL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_CTGR_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_CTGR_ENTT_DEC_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_category_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_category_entity_int`
--
ALTER TABLE `sgp_catalog_category_entity_int`
  ADD CONSTRAINT `SGP_CATALOG_CATEGORY_ENTITY_INT_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_CTGR_ENTT_INT_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_CTGR_ENTT_INT_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_category_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_category_entity_text`
--
ALTER TABLE `sgp_catalog_category_entity_text`
  ADD CONSTRAINT `SGP_CATALOG_CATEGORY_ENTITY_TEXT_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_CTGR_ENTT_TEXT_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_CTGR_ENTT_TEXT_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_category_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_category_entity_varchar`
--
ALTER TABLE `sgp_catalog_category_entity_varchar`
  ADD CONSTRAINT `SGP_CATALOG_CATEGORY_ENTITY_VARCHAR_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_CTGR_ENTT_VCHR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_CTGR_ENTT_VCHR_ENTT_ID_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_category_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_category_product`
--
ALTER TABLE `sgp_catalog_category_product`
  ADD CONSTRAINT `SGP_CAT_CTGR_PRD_CTGR_ID_SGP_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`category_id`) REFERENCES `sgp_catalog_category_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_CTGR_PRD_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_compare_item`
--
ALTER TABLE `sgp_catalog_compare_item`
  ADD CONSTRAINT `SGP_CATALOG_COMPARE_ITEM_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CATALOG_COMPARE_ITEM_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL,
  ADD CONSTRAINT `SGP_CAT_CMP_ITEM_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_eav_attribute`
--
ALTER TABLE `sgp_catalog_eav_attribute`
  ADD CONSTRAINT `SGP_CAT_EAV_ATTR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_bundle_option`
--
ALTER TABLE `sgp_catalog_product_bundle_option`
  ADD CONSTRAINT `SGP_CAT_PRD_BNDL_OPT_PARENT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`parent_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_bundle_option_value`
--
ALTER TABLE `sgp_catalog_product_bundle_option_value`
  ADD CONSTRAINT `SGP_CAT_PRD_BNDL_OPT_VAL_OPT_ID_CAT_PRD_BNDL_OPT_OPT_ID` FOREIGN KEY (`option_id`) REFERENCES `sgp_catalog_product_bundle_option` (`option_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_bundle_price_index`
--
ALTER TABLE `sgp_catalog_product_bundle_price_index`
  ADD CONSTRAINT `FK_8E2B04AEED546C2EA65076B45ECE3E86` FOREIGN KEY (`customer_group_id`) REFERENCES `sgp_customer_group` (`customer_group_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_BNDL_PRICE_IDX_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_BNDL_PRICE_IDX_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_bundle_selection`
--
ALTER TABLE `sgp_catalog_product_bundle_selection`
  ADD CONSTRAINT `SGP_CAT_PRD_BNDL_SELECTION_OPT_ID_CAT_PRD_BNDL_OPT_OPT_ID` FOREIGN KEY (`option_id`) REFERENCES `sgp_catalog_product_bundle_option` (`option_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_BNDL_SELECTION_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_bundle_selection_price`
--
ALTER TABLE `sgp_catalog_product_bundle_selection_price`
  ADD CONSTRAINT `FK_2C478C6247F7C70FA24C796D75DF50ED` FOREIGN KEY (`selection_id`) REFERENCES `sgp_catalog_product_bundle_selection` (`selection_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_BNDL_SELECTION_PRICE_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_entity`
--
ALTER TABLE `sgp_catalog_product_entity`
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `sgp_eav_attribute_set` (`attribute_set_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_entity_datetime`
--
ALTER TABLE `sgp_catalog_product_entity_datetime`
  ADD CONSTRAINT `SGP_CATALOG_PRODUCT_ENTITY_DATETIME_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_DTIME_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_DTIME_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_entity_decimal`
--
ALTER TABLE `sgp_catalog_product_entity_decimal`
  ADD CONSTRAINT `SGP_CATALOG_PRODUCT_ENTITY_DECIMAL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_DEC_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_entity_gallery`
--
ALTER TABLE `sgp_catalog_product_entity_gallery`
  ADD CONSTRAINT `SGP_CATALOG_PRODUCT_ENTITY_GALLERY_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_GLR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_GLR_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_entity_int`
--
ALTER TABLE `sgp_catalog_product_entity_int`
  ADD CONSTRAINT `SGP_CATALOG_PRODUCT_ENTITY_INT_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_INT_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_INT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_entity_media_gallery`
--
ALTER TABLE `sgp_catalog_product_entity_media_gallery`
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_MDA_GLR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_entity_media_gallery_value`
--
ALTER TABLE `sgp_catalog_product_entity_media_gallery_value`
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_MDA_GLR_VAL_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_MDA_GLR_VAL_STORE_ID_SGP_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_MDA_GLR_VAL_VAL_ID_CAT_PRD_ENTT_MDA_GLR_VAL_ID` FOREIGN KEY (`value_id`) REFERENCES `sgp_catalog_product_entity_media_gallery` (`value_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_entity_media_gallery_value_to_entity`
--
ALTER TABLE `sgp_catalog_product_entity_media_gallery_value_to_entity`
  ADD CONSTRAINT `FK_1F838A9A5F4D3CDB038A51B4F9E8902F` FOREIGN KEY (`value_id`) REFERENCES `sgp_catalog_product_entity_media_gallery` (`value_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_EC24C0B66A930DEF32AE1075F4CE44F1` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_entity_media_gallery_value_video`
--
ALTER TABLE `sgp_catalog_product_entity_media_gallery_value_video`
  ADD CONSTRAINT `FK_798B07DF68AB3D0688F38FF442FB9D77` FOREIGN KEY (`value_id`) REFERENCES `sgp_catalog_product_entity_media_gallery` (`value_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_MDA_GLR_VAL_VIDEO_STORE_ID_SGP_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_entity_text`
--
ALTER TABLE `sgp_catalog_product_entity_text`
  ADD CONSTRAINT `SGP_CATALOG_PRODUCT_ENTITY_TEXT_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_TEXT_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_TEXT_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_entity_tier_price`
--
ALTER TABLE `sgp_catalog_product_entity_tier_price`
  ADD CONSTRAINT `FK_8DAA34E0C41B5EE4C9B31AD192DFFC70` FOREIGN KEY (`customer_group_id`) REFERENCES `sgp_customer_group` (`customer_group_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_TIER_PRICE_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_TIER_PRICE_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_entity_varchar`
--
ALTER TABLE `sgp_catalog_product_entity_varchar`
  ADD CONSTRAINT `SGP_CATALOG_PRODUCT_ENTITY_VARCHAR_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_VCHR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_ENTT_VCHR_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_index_price`
--
ALTER TABLE `sgp_catalog_product_index_price`
  ADD CONSTRAINT `SGP_CAT_PRD_IDX_PRICE_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID` FOREIGN KEY (`customer_group_id`) REFERENCES `sgp_customer_group` (`customer_group_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_IDX_PRICE_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_IDX_PRICE_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_index_tier_price`
--
ALTER TABLE `sgp_catalog_product_index_tier_price`
  ADD CONSTRAINT `FK_EBDE19F8EA3012790ACAF666C3530467` FOREIGN KEY (`customer_group_id`) REFERENCES `sgp_customer_group` (`customer_group_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_IDX_TIER_PRICE_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_IDX_TIER_PRICE_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_index_website`
--
ALTER TABLE `sgp_catalog_product_index_website`
  ADD CONSTRAINT `SGP_CAT_PRD_IDX_WS_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_link`
--
ALTER TABLE `sgp_catalog_product_link`
  ADD CONSTRAINT `SGP_CAT_PRD_LNK_LNKED_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`linked_product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_LNK_LNK_TYPE_ID_CAT_PRD_LNK_TYPE_LNK_TYPE_ID` FOREIGN KEY (`link_type_id`) REFERENCES `sgp_catalog_product_link_type` (`link_type_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_LNK_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_link_attribute`
--
ALTER TABLE `sgp_catalog_product_link_attribute`
  ADD CONSTRAINT `SGP_CAT_PRD_LNK_ATTR_LNK_TYPE_ID_CAT_PRD_LNK_TYPE_LNK_TYPE_ID` FOREIGN KEY (`link_type_id`) REFERENCES `sgp_catalog_product_link_type` (`link_type_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_link_attribute_decimal`
--
ALTER TABLE `sgp_catalog_product_link_attribute_decimal`
  ADD CONSTRAINT `FK_62EC92E6C505AC0BE21B411CB8C501D1` FOREIGN KEY (`product_link_attribute_id`) REFERENCES `sgp_catalog_product_link_attribute` (`product_link_attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_LNK_ATTR_DEC_LNK_ID_CAT_PRD_LNK_LNK_ID` FOREIGN KEY (`link_id`) REFERENCES `sgp_catalog_product_link` (`link_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_link_attribute_int`
--
ALTER TABLE `sgp_catalog_product_link_attribute_int`
  ADD CONSTRAINT `FK_DF813F9C59FD76520565BC0F626AE561` FOREIGN KEY (`product_link_attribute_id`) REFERENCES `sgp_catalog_product_link_attribute` (`product_link_attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_LNK_ATTR_INT_LNK_ID_CAT_PRD_LNK_LNK_ID` FOREIGN KEY (`link_id`) REFERENCES `sgp_catalog_product_link` (`link_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_link_attribute_varchar`
--
ALTER TABLE `sgp_catalog_product_link_attribute_varchar`
  ADD CONSTRAINT `FK_4AFA373F0584538C0D02EB5335F001B4` FOREIGN KEY (`product_link_attribute_id`) REFERENCES `sgp_catalog_product_link_attribute` (`product_link_attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_LNK_ATTR_VCHR_LNK_ID_CAT_PRD_LNK_LNK_ID` FOREIGN KEY (`link_id`) REFERENCES `sgp_catalog_product_link` (`link_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_option`
--
ALTER TABLE `sgp_catalog_product_option`
  ADD CONSTRAINT `SGP_CAT_PRD_OPT_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_option_price`
--
ALTER TABLE `sgp_catalog_product_option_price`
  ADD CONSTRAINT `SGP_CATALOG_PRODUCT_OPTION_PRICE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_OPT_PRICE_OPT_ID_CAT_PRD_OPT_OPT_ID` FOREIGN KEY (`option_id`) REFERENCES `sgp_catalog_product_option` (`option_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_option_title`
--
ALTER TABLE `sgp_catalog_product_option_title`
  ADD CONSTRAINT `SGP_CATALOG_PRODUCT_OPTION_TITLE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_OPT_TTL_OPT_ID_CAT_PRD_OPT_OPT_ID` FOREIGN KEY (`option_id`) REFERENCES `sgp_catalog_product_option` (`option_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_option_type_price`
--
ALTER TABLE `sgp_catalog_product_option_type_price`
  ADD CONSTRAINT `FK_A5EAEED1FE4A1CA1DCBC9E14486CDFC5` FOREIGN KEY (`option_type_id`) REFERENCES `sgp_catalog_product_option_type_value` (`option_type_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CATALOG_PRODUCT_OPTION_TYPE_PRICE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_option_type_title`
--
ALTER TABLE `sgp_catalog_product_option_type_title`
  ADD CONSTRAINT `FK_B37853F3EA69E9F0C8E2F8CCC354CE1E` FOREIGN KEY (`option_type_id`) REFERENCES `sgp_catalog_product_option_type_value` (`option_type_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CATALOG_PRODUCT_OPTION_TYPE_TITLE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_option_type_value`
--
ALTER TABLE `sgp_catalog_product_option_type_value`
  ADD CONSTRAINT `SGP_CAT_PRD_OPT_TYPE_VAL_OPT_ID_CAT_PRD_OPT_OPT_ID` FOREIGN KEY (`option_id`) REFERENCES `sgp_catalog_product_option` (`option_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_relation`
--
ALTER TABLE `sgp_catalog_product_relation`
  ADD CONSTRAINT `SGP_CAT_PRD_RELATION_CHILD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`child_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_RELATION_PARENT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`parent_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_super_attribute`
--
ALTER TABLE `sgp_catalog_product_super_attribute`
  ADD CONSTRAINT `SGP_CAT_PRD_SPR_ATTR_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_super_attribute_label`
--
ALTER TABLE `sgp_catalog_product_super_attribute_label`
  ADD CONSTRAINT `FK_0BD9B0545E3DBFD5A8DA9B22B41BC62D` FOREIGN KEY (`product_super_attribute_id`) REFERENCES `sgp_catalog_product_super_attribute` (`product_super_attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_SPR_ATTR_LBL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_super_link`
--
ALTER TABLE `sgp_catalog_product_super_link`
  ADD CONSTRAINT `SGP_CAT_PRD_SPR_LNK_PARENT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`parent_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_SPR_LNK_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_product_website`
--
ALTER TABLE `sgp_catalog_product_website`
  ADD CONSTRAINT `SGP_CATALOG_PRODUCT_WEBSITE_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_PRD_WS_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_catalog_url_rewrite_product_category`
--
ALTER TABLE `sgp_catalog_url_rewrite_product_category`
  ADD CONSTRAINT `FK_2EF4E10A8E5E7AB707FF0ADE208F4CB0` FOREIGN KEY (`url_rewrite_id`) REFERENCES `sgp_url_rewrite` (`url_rewrite_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_URL_REWRITE_PRD_CTGR_CTGR_ID_SGP_CAT_CTGR_ENTT_ENTT_ID` FOREIGN KEY (`category_id`) REFERENCES `sgp_catalog_category_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CAT_URL_REWRITE_PRD_CTGR_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_checkout_agreement_store`
--
ALTER TABLE `sgp_checkout_agreement_store`
  ADD CONSTRAINT `SGP_CHECKOUT_AGREEMENT_STORE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CHKT_AGRT_STORE_AGRT_ID_CHKT_AGRT_AGRT_ID` FOREIGN KEY (`agreement_id`) REFERENCES `sgp_checkout_agreement` (`agreement_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_cms_block_store`
--
ALTER TABLE `sgp_cms_block_store`
  ADD CONSTRAINT `SGP_CMS_BLOCK_STORE_BLOCK_ID_CMS_BLOCK_BLOCK_ID` FOREIGN KEY (`block_id`) REFERENCES `sgp_cms_block` (`block_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CMS_BLOCK_STORE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_cms_page_store`
--
ALTER TABLE `sgp_cms_page_store`
  ADD CONSTRAINT `SGP_CMS_PAGE_STORE_PAGE_ID_CMS_PAGE_PAGE_ID` FOREIGN KEY (`page_id`) REFERENCES `sgp_cms_page` (`page_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CMS_PAGE_STORE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_address_entity`
--
ALTER TABLE `sgp_customer_address_entity`
  ADD CONSTRAINT `SGP_CUSTOMER_ADDRESS_ENTITY_PARENT_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`parent_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_address_entity_datetime`
--
ALTER TABLE `sgp_customer_address_entity_datetime`
  ADD CONSTRAINT `SGP_CSTR_ADDR_ENTT_DTIME_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CSTR_ADDR_ENTT_DTIME_ENTT_ID_CSTR_ADDR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_customer_address_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_address_entity_decimal`
--
ALTER TABLE `sgp_customer_address_entity_decimal`
  ADD CONSTRAINT `SGP_CSTR_ADDR_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CSTR_ADDR_ENTT_DEC_ENTT_ID_CSTR_ADDR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_customer_address_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_address_entity_int`
--
ALTER TABLE `sgp_customer_address_entity_int`
  ADD CONSTRAINT `SGP_CSTR_ADDR_ENTT_INT_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CSTR_ADDR_ENTT_INT_ENTT_ID_CSTR_ADDR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_customer_address_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_address_entity_text`
--
ALTER TABLE `sgp_customer_address_entity_text`
  ADD CONSTRAINT `SGP_CSTR_ADDR_ENTT_TEXT_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CSTR_ADDR_ENTT_TEXT_ENTT_ID_CSTR_ADDR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_customer_address_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_address_entity_varchar`
--
ALTER TABLE `sgp_customer_address_entity_varchar`
  ADD CONSTRAINT `SGP_CSTR_ADDR_ENTT_VCHR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CSTR_ADDR_ENTT_VCHR_ENTT_ID_CSTR_ADDR_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_customer_address_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_eav_attribute`
--
ALTER TABLE `sgp_customer_eav_attribute`
  ADD CONSTRAINT `SGP_CSTR_EAV_ATTR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_eav_attribute_website`
--
ALTER TABLE `sgp_customer_eav_attribute_website`
  ADD CONSTRAINT `SGP_CSTR_EAV_ATTR_WS_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CSTR_EAV_ATTR_WS_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_entity_datetime`
--
ALTER TABLE `sgp_customer_entity_datetime`
  ADD CONSTRAINT `SGP_CSTR_ENTT_DTIME_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CUSTOMER_ENTITY_DATETIME_ENTITY_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_entity_decimal`
--
ALTER TABLE `sgp_customer_entity_decimal`
  ADD CONSTRAINT `SGP_CSTR_ENTT_DEC_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CUSTOMER_ENTITY_DECIMAL_ENTITY_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_entity_int`
--
ALTER TABLE `sgp_customer_entity_int`
  ADD CONSTRAINT `SGP_CUSTOMER_ENTITY_INT_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CUSTOMER_ENTITY_INT_ENTITY_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_entity_text`
--
ALTER TABLE `sgp_customer_entity_text`
  ADD CONSTRAINT `SGP_CUSTOMER_ENTITY_TEXT_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CUSTOMER_ENTITY_TEXT_ENTITY_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_entity_varchar`
--
ALTER TABLE `sgp_customer_entity_varchar`
  ADD CONSTRAINT `SGP_CSTR_ENTT_VCHR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_CUSTOMER_ENTITY_VARCHAR_ENTITY_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_customer_form_attribute`
--
ALTER TABLE `sgp_customer_form_attribute`
  ADD CONSTRAINT `SGP_CSTR_FORM_ATTR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_design_change`
--
ALTER TABLE `sgp_design_change`
  ADD CONSTRAINT `SGP_DESIGN_CHANGE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_directory_country_region_name`
--
ALTER TABLE `sgp_directory_country_region_name`
  ADD CONSTRAINT `FK_04F51EBDDB1672D05B98C8BB409727D0` FOREIGN KEY (`region_id`) REFERENCES `sgp_directory_country_region` (`region_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_downloadable_link`
--
ALTER TABLE `sgp_downloadable_link`
  ADD CONSTRAINT `SGP_DL_LNK_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_downloadable_link_price`
--
ALTER TABLE `sgp_downloadable_link_price`
  ADD CONSTRAINT `SGP_DOWNLOADABLE_LINK_PRICE_LINK_ID_DOWNLOADABLE_LINK_LINK_ID` FOREIGN KEY (`link_id`) REFERENCES `sgp_downloadable_link` (`link_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_DOWNLOADABLE_LINK_PRICE_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_downloadable_link_purchased`
--
ALTER TABLE `sgp_downloadable_link_purchased`
  ADD CONSTRAINT `SGP_DL_LNK_PURCHASED_CSTR_ID_CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE SET NULL,
  ADD CONSTRAINT `SGP_DOWNLOADABLE_LINK_PURCHASED_ORDER_ID_SALES_ORDER_ENTITY_ID` FOREIGN KEY (`order_id`) REFERENCES `sgp_sales_order` (`entity_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_downloadable_link_purchased_item`
--
ALTER TABLE `sgp_downloadable_link_purchased_item`
  ADD CONSTRAINT `FK_14258B6150D26B07A16ACBA90A654105` FOREIGN KEY (`purchased_id`) REFERENCES `sgp_downloadable_link_purchased` (`purchased_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_DL_LNK_PURCHASED_ITEM_ORDER_ITEM_ID_SALES_ORDER_ITEM_ITEM_ID` FOREIGN KEY (`order_item_id`) REFERENCES `sgp_sales_order_item` (`item_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_downloadable_link_title`
--
ALTER TABLE `sgp_downloadable_link_title`
  ADD CONSTRAINT `SGP_DOWNLOADABLE_LINK_TITLE_LINK_ID_DOWNLOADABLE_LINK_LINK_ID` FOREIGN KEY (`link_id`) REFERENCES `sgp_downloadable_link` (`link_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_DOWNLOADABLE_LINK_TITLE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_downloadable_sample`
--
ALTER TABLE `sgp_downloadable_sample`
  ADD CONSTRAINT `SGP_DL_SAMPLE_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_downloadable_sample_title`
--
ALTER TABLE `sgp_downloadable_sample_title`
  ADD CONSTRAINT `SGP_DL_SAMPLE_TTL_SAMPLE_ID_DL_SAMPLE_SAMPLE_ID` FOREIGN KEY (`sample_id`) REFERENCES `sgp_downloadable_sample` (`sample_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_DOWNLOADABLE_SAMPLE_TITLE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_attribute`
--
ALTER TABLE `sgp_eav_attribute`
  ADD CONSTRAINT `SGP_EAV_ATTRIBUTE_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `sgp_eav_entity_type` (`entity_type_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_attribute_group`
--
ALTER TABLE `sgp_eav_attribute_group`
  ADD CONSTRAINT `SGP_EAV_ATTR_GROUP_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `sgp_eav_attribute_set` (`attribute_set_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_attribute_label`
--
ALTER TABLE `sgp_eav_attribute_label`
  ADD CONSTRAINT `SGP_EAV_ATTRIBUTE_LABEL_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ATTRIBUTE_LABEL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_attribute_option`
--
ALTER TABLE `sgp_eav_attribute_option`
  ADD CONSTRAINT `SGP_EAV_ATTRIBUTE_OPTION_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_attribute_option_swatch`
--
ALTER TABLE `sgp_eav_attribute_option_swatch`
  ADD CONSTRAINT `SGP_EAV_ATTRIBUTE_OPTION_SWATCH_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ATTR_OPT_SWATCH_OPT_ID_EAV_ATTR_OPT_OPT_ID` FOREIGN KEY (`option_id`) REFERENCES `sgp_eav_attribute_option` (`option_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_attribute_option_value`
--
ALTER TABLE `sgp_eav_attribute_option_value`
  ADD CONSTRAINT `SGP_EAV_ATTRIBUTE_OPTION_VALUE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ATTR_OPT_VAL_OPT_ID_EAV_ATTR_OPT_OPT_ID` FOREIGN KEY (`option_id`) REFERENCES `sgp_eav_attribute_option` (`option_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_attribute_set`
--
ALTER TABLE `sgp_eav_attribute_set`
  ADD CONSTRAINT `SGP_EAV_ATTR_SET_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `sgp_eav_entity_type` (`entity_type_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_entity`
--
ALTER TABLE `sgp_eav_entity`
  ADD CONSTRAINT `SGP_EAV_ENTITY_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `sgp_eav_entity_type` (`entity_type_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ENTITY_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_entity_attribute`
--
ALTER TABLE `sgp_eav_entity_attribute`
  ADD CONSTRAINT `SGP_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ENTT_ATTR_ATTR_GROUP_ID_EAV_ATTR_GROUP_ATTR_GROUP_ID` FOREIGN KEY (`attribute_group_id`) REFERENCES `sgp_eav_attribute_group` (`attribute_group_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_entity_datetime`
--
ALTER TABLE `sgp_eav_entity_datetime`
  ADD CONSTRAINT `SGP_EAV_ENTITY_DATETIME_ENTITY_ID_EAV_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_eav_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ENTITY_DATETIME_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ENTT_DTIME_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `sgp_eav_entity_type` (`entity_type_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_entity_decimal`
--
ALTER TABLE `sgp_eav_entity_decimal`
  ADD CONSTRAINT `SGP_EAV_ENTITY_DECIMAL_ENTITY_ID_EAV_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_eav_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ENTITY_DECIMAL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ENTT_DEC_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `sgp_eav_entity_type` (`entity_type_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_entity_int`
--
ALTER TABLE `sgp_eav_entity_int`
  ADD CONSTRAINT `SGP_EAV_ENTITY_INT_ENTITY_ID_EAV_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_eav_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ENTITY_INT_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `sgp_eav_entity_type` (`entity_type_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ENTITY_INT_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_entity_store`
--
ALTER TABLE `sgp_eav_entity_store`
  ADD CONSTRAINT `SGP_EAV_ENTITY_STORE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ENTT_STORE_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `sgp_eav_entity_type` (`entity_type_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_entity_text`
--
ALTER TABLE `sgp_eav_entity_text`
  ADD CONSTRAINT `SGP_EAV_ENTITY_TEXT_ENTITY_ID_EAV_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_eav_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ENTITY_TEXT_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ENTT_TEXT_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `sgp_eav_entity_type` (`entity_type_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_entity_varchar`
--
ALTER TABLE `sgp_eav_entity_varchar`
  ADD CONSTRAINT `SGP_EAV_ENTITY_VARCHAR_ENTITY_ID_EAV_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_eav_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ENTITY_VARCHAR_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_ENTT_VCHR_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `sgp_eav_entity_type` (`entity_type_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_form_element`
--
ALTER TABLE `sgp_eav_form_element`
  ADD CONSTRAINT `SGP_EAV_FORM_ELEMENT_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_FORM_ELEMENT_FIELDSET_ID_EAV_FORM_FIELDSET_FIELDSET_ID` FOREIGN KEY (`fieldset_id`) REFERENCES `sgp_eav_form_fieldset` (`fieldset_id`) ON DELETE SET NULL,
  ADD CONSTRAINT `SGP_EAV_FORM_ELEMENT_TYPE_ID_EAV_FORM_TYPE_TYPE_ID` FOREIGN KEY (`type_id`) REFERENCES `sgp_eav_form_type` (`type_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_form_fieldset`
--
ALTER TABLE `sgp_eav_form_fieldset`
  ADD CONSTRAINT `SGP_EAV_FORM_FIELDSET_TYPE_ID_EAV_FORM_TYPE_TYPE_ID` FOREIGN KEY (`type_id`) REFERENCES `sgp_eav_form_type` (`type_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_form_fieldset_label`
--
ALTER TABLE `sgp_eav_form_fieldset_label`
  ADD CONSTRAINT `SGP_EAV_FORM_FIELDSET_LABEL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_FORM_FSET_LBL_FSET_ID_EAV_FORM_FSET_FSET_ID` FOREIGN KEY (`fieldset_id`) REFERENCES `sgp_eav_form_fieldset` (`fieldset_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_form_type`
--
ALTER TABLE `sgp_eav_form_type`
  ADD CONSTRAINT `SGP_EAV_FORM_TYPE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_eav_form_type_entity`
--
ALTER TABLE `sgp_eav_form_type_entity`
  ADD CONSTRAINT `SGP_EAV_FORM_TYPE_ENTITY_TYPE_ID_EAV_FORM_TYPE_TYPE_ID` FOREIGN KEY (`type_id`) REFERENCES `sgp_eav_form_type` (`type_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_EAV_FORM_TYPE_ENTT_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `sgp_eav_entity_type` (`entity_type_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_googleoptimizer_code`
--
ALTER TABLE `sgp_googleoptimizer_code`
  ADD CONSTRAINT `SGP_GOOGLEOPTIMIZER_CODE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_integration`
--
ALTER TABLE `sgp_integration`
  ADD CONSTRAINT `SGP_INTEGRATION_CONSUMER_ID_SGP_OAUTH_CONSUMER_ENTITY_ID` FOREIGN KEY (`consumer_id`) REFERENCES `sgp_oauth_consumer` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_layout_link`
--
ALTER TABLE `sgp_layout_link`
  ADD CONSTRAINT `SGP_LAYOUT_LINK_LAYOUT_UPDATE_ID_LAYOUT_UPDATE_LAYOUT_UPDATE_ID` FOREIGN KEY (`layout_update_id`) REFERENCES `sgp_layout_update` (`layout_update_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_LAYOUT_LINK_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_LAYOUT_LINK_THEME_ID_THEME_THEME_ID` FOREIGN KEY (`theme_id`) REFERENCES `sgp_theme` (`theme_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_newsletter_problem`
--
ALTER TABLE `sgp_newsletter_problem`
  ADD CONSTRAINT `SGP_NEWSLETTER_PROBLEM_QUEUE_ID_NEWSLETTER_QUEUE_QUEUE_ID` FOREIGN KEY (`queue_id`) REFERENCES `sgp_newsletter_queue` (`queue_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_NLTTR_PROBLEM_SUBSCRIBER_ID_NLTTR_SUBSCRIBER_SUBSCRIBER_ID` FOREIGN KEY (`subscriber_id`) REFERENCES `sgp_newsletter_subscriber` (`subscriber_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_newsletter_queue`
--
ALTER TABLE `sgp_newsletter_queue`
  ADD CONSTRAINT `SGP_NEWSLETTER_QUEUE_TEMPLATE_ID_NEWSLETTER_TEMPLATE_TEMPLATE_ID` FOREIGN KEY (`template_id`) REFERENCES `sgp_newsletter_template` (`template_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_newsletter_queue_link`
--
ALTER TABLE `sgp_newsletter_queue_link`
  ADD CONSTRAINT `SGP_NEWSLETTER_QUEUE_LINK_QUEUE_ID_NEWSLETTER_QUEUE_QUEUE_ID` FOREIGN KEY (`queue_id`) REFERENCES `sgp_newsletter_queue` (`queue_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_NLTTR_QUEUE_LNK_SUBSCRIBER_ID_NLTTR_SUBSCRIBER_SUBSCRIBER_ID` FOREIGN KEY (`subscriber_id`) REFERENCES `sgp_newsletter_subscriber` (`subscriber_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_newsletter_queue_store_link`
--
ALTER TABLE `sgp_newsletter_queue_store_link`
  ADD CONSTRAINT `SGP_NEWSLETTER_QUEUE_STORE_LINK_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_NLTTR_QUEUE_STORE_LNK_QUEUE_ID_NLTTR_QUEUE_QUEUE_ID` FOREIGN KEY (`queue_id`) REFERENCES `sgp_newsletter_queue` (`queue_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_oauth_nonce`
--
ALTER TABLE `sgp_oauth_nonce`
  ADD CONSTRAINT `SGP_OAUTH_NONCE_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID` FOREIGN KEY (`consumer_id`) REFERENCES `sgp_oauth_consumer` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_oauth_token`
--
ALTER TABLE `sgp_oauth_token`
  ADD CONSTRAINT `SGP_OAUTH_TOKEN_ADMIN_ID_ADMIN_USER_USER_ID` FOREIGN KEY (`admin_id`) REFERENCES `sgp_admin_user` (`user_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_OAUTH_TOKEN_CONSUMER_ID_OAUTH_CONSUMER_ENTITY_ID` FOREIGN KEY (`consumer_id`) REFERENCES `sgp_oauth_consumer` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_OAUTH_TOKEN_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_paypal_billing_agreement`
--
ALTER TABLE `sgp_paypal_billing_agreement`
  ADD CONSTRAINT `SGP_PAYPAL_BILLING_AGREEMENT_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL,
  ADD CONSTRAINT `SGP_PAYPAL_BILLING_AGRT_CSTR_ID_CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_paypal_billing_agreement_order`
--
ALTER TABLE `sgp_paypal_billing_agreement_order`
  ADD CONSTRAINT `FK_D371E94C28E0EE0C9DC3B5FB6F12CF7A` FOREIGN KEY (`agreement_id`) REFERENCES `sgp_paypal_billing_agreement` (`agreement_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_PAYPAL_BILLING_AGRT_ORDER_ORDER_ID_SALES_ORDER_ENTT_ID` FOREIGN KEY (`order_id`) REFERENCES `sgp_sales_order` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_paypal_cert`
--
ALTER TABLE `sgp_paypal_cert`
  ADD CONSTRAINT `SGP_PAYPAL_CERT_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_paypal_settlement_report_row`
--
ALTER TABLE `sgp_paypal_settlement_report_row`
  ADD CONSTRAINT `FK_C5E260C68E05E482B2ECBB994C99ED8E` FOREIGN KEY (`report_id`) REFERENCES `sgp_paypal_settlement_report` (`report_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_persistent_session`
--
ALTER TABLE `sgp_persistent_session`
  ADD CONSTRAINT `SGP_PERSISTENT_SESSION_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_PERSISTENT_SESSION_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_plazathemes_blog_category_store`
--
ALTER TABLE `sgp_plazathemes_blog_category_store`
  ADD CONSTRAINT `FK_7B73CE93832F95386A6C3CD441E56CFD` FOREIGN KEY (`category_id`) REFERENCES `sgp_plazathemes_blog_category` (`category_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_PLAZATHEMES_BLOG_CATEGORY_STORE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_plazathemes_blog_post_category`
--
ALTER TABLE `sgp_plazathemes_blog_post_category`
  ADD CONSTRAINT `FK_636F15C89730A45355C5CD772793B591` FOREIGN KEY (`post_id`) REFERENCES `sgp_plazathemes_blog_post` (`post_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_B96D25E41E38638DF5E2868096D716C2` FOREIGN KEY (`category_id`) REFERENCES `sgp_plazathemes_blog_category` (`category_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_plazathemes_blog_post_relatedpost`
--
ALTER TABLE `sgp_plazathemes_blog_post_relatedpost`
  ADD CONSTRAINT `FK_8892849C9EEA9300BBE9B0F35587A732` FOREIGN KEY (`post_id`) REFERENCES `sgp_plazathemes_blog_post` (`post_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_F4C3217F8857BB5E23EA5502F08B032B` FOREIGN KEY (`post_id`) REFERENCES `sgp_plazathemes_blog_post` (`post_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_plazathemes_blog_post_relatedproduct`
--
ALTER TABLE `sgp_plazathemes_blog_post_relatedproduct`
  ADD CONSTRAINT `FK_48A25CAABAD585DCF6A7FD26D86ED7EE` FOREIGN KEY (`post_id`) REFERENCES `sgp_plazathemes_blog_post` (`post_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_8F2F1C9D36DDDE6CE95DF82DD57A54E6` FOREIGN KEY (`related_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_plazathemes_blog_post_store`
--
ALTER TABLE `sgp_plazathemes_blog_post_store`
  ADD CONSTRAINT `FK_5390B14454BB2796067C95F3F8FEC03D` FOREIGN KEY (`post_id`) REFERENCES `sgp_plazathemes_blog_post` (`post_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_PLAZATHEMES_BLOG_POST_STORE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_product_alert_price`
--
ALTER TABLE `sgp_product_alert_price`
  ADD CONSTRAINT `SGP_PRD_ALERT_PRICE_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_PRODUCT_ALERT_PRICE_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_PRODUCT_ALERT_PRICE_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_product_alert_stock`
--
ALTER TABLE `sgp_product_alert_stock`
  ADD CONSTRAINT `SGP_PRD_ALERT_STOCK_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_PRODUCT_ALERT_STOCK_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_PRODUCT_ALERT_STOCK_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_quote_address`
--
ALTER TABLE `sgp_quote_address`
  ADD CONSTRAINT `SGP_QUOTE_ADDRESS_QUOTE_ID_QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES `sgp_quote` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_quote_address_item`
--
ALTER TABLE `sgp_quote_address_item`
  ADD CONSTRAINT `SGP_QUOTE_ADDRESS_ITEM_QUOTE_ADDRESS_ID_QUOTE_ADDRESS_ADDRESS_ID` FOREIGN KEY (`quote_address_id`) REFERENCES `sgp_quote_address` (`address_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_QUOTE_ADDRESS_ITEM_QUOTE_ITEM_ID_QUOTE_ITEM_ITEM_ID` FOREIGN KEY (`quote_item_id`) REFERENCES `sgp_quote_item` (`item_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_QUOTE_ADDR_ITEM_PARENT_ITEM_ID_QUOTE_ADDR_ITEM_ADDR_ITEM_ID` FOREIGN KEY (`parent_item_id`) REFERENCES `sgp_quote_address_item` (`address_item_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_quote_id_mask`
--
ALTER TABLE `sgp_quote_id_mask`
  ADD CONSTRAINT `SGP_QUOTE_ID_MASK_QUOTE_ID_QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES `sgp_quote` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_quote_item`
--
ALTER TABLE `sgp_quote_item`
  ADD CONSTRAINT `SGP_QUOTE_ITEM_PARENT_ITEM_ID_QUOTE_ITEM_ITEM_ID` FOREIGN KEY (`parent_item_id`) REFERENCES `sgp_quote_item` (`item_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_QUOTE_ITEM_QUOTE_ID_QUOTE_ENTITY_ID` FOREIGN KEY (`quote_id`) REFERENCES `sgp_quote` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_QUOTE_ITEM_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_quote_item_option`
--
ALTER TABLE `sgp_quote_item_option`
  ADD CONSTRAINT `SGP_QUOTE_ITEM_OPTION_ITEM_ID_QUOTE_ITEM_ITEM_ID` FOREIGN KEY (`item_id`) REFERENCES `sgp_quote_item` (`item_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_quote_shipping_rate`
--
ALTER TABLE `sgp_quote_shipping_rate`
  ADD CONSTRAINT `SGP_QUOTE_SHIPPING_RATE_ADDRESS_ID_QUOTE_ADDRESS_ADDRESS_ID` FOREIGN KEY (`address_id`) REFERENCES `sgp_quote_address` (`address_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_rating`
--
ALTER TABLE `sgp_rating`
  ADD CONSTRAINT `SGP_RATING_ENTITY_ID_RATING_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_rating_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_rating_option`
--
ALTER TABLE `sgp_rating_option`
  ADD CONSTRAINT `SGP_RATING_OPTION_RATING_ID_RATING_RATING_ID` FOREIGN KEY (`rating_id`) REFERENCES `sgp_rating` (`rating_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_rating_option_vote`
--
ALTER TABLE `sgp_rating_option_vote`
  ADD CONSTRAINT `SGP_RATING_OPTION_VOTE_OPTION_ID_RATING_OPTION_OPTION_ID` FOREIGN KEY (`option_id`) REFERENCES `sgp_rating_option` (`option_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_RATING_OPTION_VOTE_REVIEW_ID_REVIEW_REVIEW_ID` FOREIGN KEY (`review_id`) REFERENCES `sgp_review` (`review_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_rating_option_vote_aggregated`
--
ALTER TABLE `sgp_rating_option_vote_aggregated`
  ADD CONSTRAINT `SGP_RATING_OPTION_VOTE_AGGREGATED_RATING_ID_RATING_RATING_ID` FOREIGN KEY (`rating_id`) REFERENCES `sgp_rating` (`rating_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_RATING_OPTION_VOTE_AGGREGATED_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_rating_store`
--
ALTER TABLE `sgp_rating_store`
  ADD CONSTRAINT `SGP_RATING_STORE_RATING_ID_RATING_RATING_ID` FOREIGN KEY (`rating_id`) REFERENCES `sgp_rating` (`rating_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_RATING_STORE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_rating_title`
--
ALTER TABLE `sgp_rating_title`
  ADD CONSTRAINT `SGP_RATING_TITLE_RATING_ID_RATING_RATING_ID` FOREIGN KEY (`rating_id`) REFERENCES `sgp_rating` (`rating_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_RATING_TITLE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_report_compared_product_index`
--
ALTER TABLE `sgp_report_compared_product_index`
  ADD CONSTRAINT `SGP_REPORT_CMPD_PRD_IDX_CSTR_ID_CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_REPORT_CMPD_PRD_IDX_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_REPORT_COMPARED_PRODUCT_INDEX_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_report_event`
--
ALTER TABLE `sgp_report_event`
  ADD CONSTRAINT `SGP_REPORT_EVENT_EVENT_TYPE_ID_REPORT_EVENT_TYPES_EVENT_TYPE_ID` FOREIGN KEY (`event_type_id`) REFERENCES `sgp_report_event_types` (`event_type_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_REPORT_EVENT_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_report_viewed_product_aggregated_daily`
--
ALTER TABLE `sgp_report_viewed_product_aggregated_daily`
  ADD CONSTRAINT `SGP_REPORT_VIEWED_PRD_AGGRED_DAILY_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_REPORT_VIEWED_PRD_AGGRED_DAILY_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_report_viewed_product_aggregated_monthly`
--
ALTER TABLE `sgp_report_viewed_product_aggregated_monthly`
  ADD CONSTRAINT `SGP_REPORT_VIEWED_PRD_AGGRED_MONTHLY_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_REPORT_VIEWED_PRD_AGGRED_MONTHLY_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_report_viewed_product_aggregated_yearly`
--
ALTER TABLE `sgp_report_viewed_product_aggregated_yearly`
  ADD CONSTRAINT `SGP_REPORT_VIEWED_PRD_AGGRED_YEARLY_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_REPORT_VIEWED_PRD_AGGRED_YEARLY_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_report_viewed_product_index`
--
ALTER TABLE `sgp_report_viewed_product_index`
  ADD CONSTRAINT `SGP_REPORT_VIEWED_PRD_IDX_CSTR_ID_CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_REPORT_VIEWED_PRD_IDX_PRD_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_REPORT_VIEWED_PRODUCT_INDEX_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_review`
--
ALTER TABLE `sgp_review`
  ADD CONSTRAINT `SGP_REVIEW_ENTITY_ID_REVIEW_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_review_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_REVIEW_STATUS_ID_REVIEW_STATUS_STATUS_ID` FOREIGN KEY (`status_id`) REFERENCES `sgp_review_status` (`status_id`) ON DELETE NO ACTION;

--
-- Constraints for table `sgp_review_detail`
--
ALTER TABLE `sgp_review_detail`
  ADD CONSTRAINT `SGP_REVIEW_DETAIL_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE SET NULL,
  ADD CONSTRAINT `SGP_REVIEW_DETAIL_REVIEW_ID_REVIEW_REVIEW_ID` FOREIGN KEY (`review_id`) REFERENCES `sgp_review` (`review_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_REVIEW_DETAIL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_review_entity_summary`
--
ALTER TABLE `sgp_review_entity_summary`
  ADD CONSTRAINT `SGP_REVIEW_ENTITY_SUMMARY_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_review_store`
--
ALTER TABLE `sgp_review_store`
  ADD CONSTRAINT `SGP_REVIEW_STORE_REVIEW_ID_REVIEW_REVIEW_ID` FOREIGN KEY (`review_id`) REFERENCES `sgp_review` (`review_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_REVIEW_STORE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_salesrule_coupon`
--
ALTER TABLE `sgp_salesrule_coupon`
  ADD CONSTRAINT `SGP_SALESRULE_COUPON_RULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `sgp_salesrule` (`rule_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_salesrule_coupon_aggregated`
--
ALTER TABLE `sgp_salesrule_coupon_aggregated`
  ADD CONSTRAINT `SGP_SALESRULE_COUPON_AGGREGATED_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_salesrule_coupon_aggregated_order`
--
ALTER TABLE `sgp_salesrule_coupon_aggregated_order`
  ADD CONSTRAINT `SGP_SALESRULE_COUPON_AGGREGATED_ORDER_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_salesrule_coupon_aggregated_updated`
--
ALTER TABLE `sgp_salesrule_coupon_aggregated_updated`
  ADD CONSTRAINT `SGP_SALESRULE_COUPON_AGGRED_UPDATED_STORE_ID_SGP_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_salesrule_coupon_usage`
--
ALTER TABLE `sgp_salesrule_coupon_usage`
  ADD CONSTRAINT `SGP_SALESRULE_COUPON_USAGE_COUPON_ID_SALESRULE_COUPON_COUPON_ID` FOREIGN KEY (`coupon_id`) REFERENCES `sgp_salesrule_coupon` (`coupon_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALESRULE_COUPON_USAGE_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_salesrule_customer`
--
ALTER TABLE `sgp_salesrule_customer`
  ADD CONSTRAINT `SGP_SALESRULE_CUSTOMER_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALESRULE_CUSTOMER_RULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `sgp_salesrule` (`rule_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_salesrule_customer_group`
--
ALTER TABLE `sgp_salesrule_customer_group`
  ADD CONSTRAINT `SGP_SALESRULE_CSTR_GROUP_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID` FOREIGN KEY (`customer_group_id`) REFERENCES `sgp_customer_group` (`customer_group_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALESRULE_CUSTOMER_GROUP_RULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `sgp_salesrule` (`rule_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_salesrule_label`
--
ALTER TABLE `sgp_salesrule_label`
  ADD CONSTRAINT `SGP_SALESRULE_LABEL_RULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `sgp_salesrule` (`rule_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALESRULE_LABEL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_salesrule_product_attribute`
--
ALTER TABLE `sgp_salesrule_product_attribute`
  ADD CONSTRAINT `SGP_SALESRULE_PRD_ATTR_ATTR_ID_EAV_ATTR_ATTR_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALESRULE_PRD_ATTR_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID` FOREIGN KEY (`customer_group_id`) REFERENCES `sgp_customer_group` (`customer_group_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALESRULE_PRD_ATTR_WS_ID_STORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALESRULE_PRODUCT_ATTRIBUTE_RULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `sgp_salesrule` (`rule_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_salesrule_website`
--
ALTER TABLE `sgp_salesrule_website`
  ADD CONSTRAINT `SGP_SALESRULE_WEBSITE_RULE_ID_SALESRULE_RULE_ID` FOREIGN KEY (`rule_id`) REFERENCES `sgp_salesrule` (`rule_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALESRULE_WEBSITE_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_bestsellers_aggregated_daily`
--
ALTER TABLE `sgp_sales_bestsellers_aggregated_daily`
  ADD CONSTRAINT `SGP_SALES_BESTSELLERS_AGGREGATED_DAILY_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_bestsellers_aggregated_monthly`
--
ALTER TABLE `sgp_sales_bestsellers_aggregated_monthly`
  ADD CONSTRAINT `SGP_SALES_BESTSELLERS_AGGREGATED_MONTHLY_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_bestsellers_aggregated_yearly`
--
ALTER TABLE `sgp_sales_bestsellers_aggregated_yearly`
  ADD CONSTRAINT `SGP_SALES_BESTSELLERS_AGGREGATED_YEARLY_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_creditmemo`
--
ALTER TABLE `sgp_sales_creditmemo`
  ADD CONSTRAINT `SGP_SALES_CREDITMEMO_ORDER_ID_SALES_ORDER_ENTITY_ID` FOREIGN KEY (`order_id`) REFERENCES `sgp_sales_order` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALES_CREDITMEMO_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_sales_creditmemo_comment`
--
ALTER TABLE `sgp_sales_creditmemo_comment`
  ADD CONSTRAINT `SGP_SALES_CREDITMEMO_COMMENT_PARENT_ID_SALES_CREDITMEMO_ENTT_ID` FOREIGN KEY (`parent_id`) REFERENCES `sgp_sales_creditmemo` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_creditmemo_item`
--
ALTER TABLE `sgp_sales_creditmemo_item`
  ADD CONSTRAINT `SGP_SALES_CREDITMEMO_ITEM_PARENT_ID_SALES_CREDITMEMO_ENTITY_ID` FOREIGN KEY (`parent_id`) REFERENCES `sgp_sales_creditmemo` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_invoice`
--
ALTER TABLE `sgp_sales_invoice`
  ADD CONSTRAINT `SGP_SALES_INVOICE_ORDER_ID_SALES_ORDER_ENTITY_ID` FOREIGN KEY (`order_id`) REFERENCES `sgp_sales_order` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALES_INVOICE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_sales_invoiced_aggregated`
--
ALTER TABLE `sgp_sales_invoiced_aggregated`
  ADD CONSTRAINT `SGP_SALES_INVOICED_AGGREGATED_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_sales_invoiced_aggregated_order`
--
ALTER TABLE `sgp_sales_invoiced_aggregated_order`
  ADD CONSTRAINT `SGP_SALES_INVOICED_AGGREGATED_ORDER_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_sales_invoice_comment`
--
ALTER TABLE `sgp_sales_invoice_comment`
  ADD CONSTRAINT `SGP_SALES_INVOICE_COMMENT_PARENT_ID_SALES_INVOICE_ENTITY_ID` FOREIGN KEY (`parent_id`) REFERENCES `sgp_sales_invoice` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_invoice_item`
--
ALTER TABLE `sgp_sales_invoice_item`
  ADD CONSTRAINT `SGP_SALES_INVOICE_ITEM_PARENT_ID_SALES_INVOICE_ENTITY_ID` FOREIGN KEY (`parent_id`) REFERENCES `sgp_sales_invoice` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_order_address`
--
ALTER TABLE `sgp_sales_order_address`
  ADD CONSTRAINT `SGP_SALES_ORDER_ADDRESS_PARENT_ID_SALES_ORDER_ENTITY_ID` FOREIGN KEY (`parent_id`) REFERENCES `sgp_sales_order` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_order_aggregated_created`
--
ALTER TABLE `sgp_sales_order_aggregated_created`
  ADD CONSTRAINT `SGP_SALES_ORDER_AGGREGATED_CREATED_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_sales_order_aggregated_updated`
--
ALTER TABLE `sgp_sales_order_aggregated_updated`
  ADD CONSTRAINT `SGP_SALES_ORDER_AGGREGATED_UPDATED_STORE_ID_SGP_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_sales_order_item`
--
ALTER TABLE `sgp_sales_order_item`
  ADD CONSTRAINT `SGP_SALES_ORDER_ITEM_ORDER_ID_SALES_ORDER_ENTITY_ID` FOREIGN KEY (`order_id`) REFERENCES `sgp_sales_order` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALES_ORDER_ITEM_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_sales_order_status_history`
--
ALTER TABLE `sgp_sales_order_status_history`
  ADD CONSTRAINT `SGP_SALES_ORDER_STATUS_HISTORY_PARENT_ID_SALES_ORDER_ENTITY_ID` FOREIGN KEY (`parent_id`) REFERENCES `sgp_sales_order` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_order_status_label`
--
ALTER TABLE `sgp_sales_order_status_label`
  ADD CONSTRAINT `SGP_SALES_ORDER_STATUS_LABEL_STATUS_SALES_ORDER_STATUS_STATUS` FOREIGN KEY (`status`) REFERENCES `sgp_sales_order_status` (`status`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALES_ORDER_STATUS_LABEL_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_order_status_state`
--
ALTER TABLE `sgp_sales_order_status_state`
  ADD CONSTRAINT `SGP_SALES_ORDER_STATUS_STATE_STATUS_SALES_ORDER_STATUS_STATUS` FOREIGN KEY (`status`) REFERENCES `sgp_sales_order_status` (`status`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_order_tax_item`
--
ALTER TABLE `sgp_sales_order_tax_item`
  ADD CONSTRAINT `FK_1F06A752705284673A359FFA44E7B645` FOREIGN KEY (`associated_item_id`) REFERENCES `sgp_sales_order_item` (`item_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALES_ORDER_TAX_ITEM_ITEM_ID_SALES_ORDER_ITEM_ITEM_ID` FOREIGN KEY (`item_id`) REFERENCES `sgp_sales_order_item` (`item_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALES_ORDER_TAX_ITEM_TAX_ID_SALES_ORDER_TAX_TAX_ID` FOREIGN KEY (`tax_id`) REFERENCES `sgp_sales_order_tax` (`tax_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_payment_transaction`
--
ALTER TABLE `sgp_sales_payment_transaction`
  ADD CONSTRAINT `FK_3676ADA5477494585BD2744E26A88D88` FOREIGN KEY (`parent_id`) REFERENCES `sgp_sales_payment_transaction` (`transaction_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_DAEEAA7310462D42894677FF25ED2EB5` FOREIGN KEY (`payment_id`) REFERENCES `sgp_sales_order_payment` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALES_PAYMENT_TRANSACTION_ORDER_ID_SALES_ORDER_ENTITY_ID` FOREIGN KEY (`order_id`) REFERENCES `sgp_sales_order` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_refunded_aggregated`
--
ALTER TABLE `sgp_sales_refunded_aggregated`
  ADD CONSTRAINT `SGP_SALES_REFUNDED_AGGREGATED_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_sales_refunded_aggregated_order`
--
ALTER TABLE `sgp_sales_refunded_aggregated_order`
  ADD CONSTRAINT `SGP_SALES_REFUNDED_AGGREGATED_ORDER_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_sales_sequence_profile`
--
ALTER TABLE `sgp_sales_sequence_profile`
  ADD CONSTRAINT `SGP_SALES_SEQUENCE_PROFILE_META_ID_SALES_SEQUENCE_META_META_ID` FOREIGN KEY (`meta_id`) REFERENCES `sgp_sales_sequence_meta` (`meta_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_shipment`
--
ALTER TABLE `sgp_sales_shipment`
  ADD CONSTRAINT `SGP_SALES_SHIPMENT_ORDER_ID_SALES_ORDER_ENTITY_ID` FOREIGN KEY (`order_id`) REFERENCES `sgp_sales_order` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SALES_SHIPMENT_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_sales_shipment_comment`
--
ALTER TABLE `sgp_sales_shipment_comment`
  ADD CONSTRAINT `SGP_SALES_SHIPMENT_COMMENT_PARENT_ID_SALES_SHIPMENT_ENTITY_ID` FOREIGN KEY (`parent_id`) REFERENCES `sgp_sales_shipment` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_shipment_item`
--
ALTER TABLE `sgp_sales_shipment_item`
  ADD CONSTRAINT `SGP_SALES_SHIPMENT_ITEM_PARENT_ID_SALES_SHIPMENT_ENTITY_ID` FOREIGN KEY (`parent_id`) REFERENCES `sgp_sales_shipment` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_shipment_track`
--
ALTER TABLE `sgp_sales_shipment_track`
  ADD CONSTRAINT `SGP_SALES_SHIPMENT_TRACK_PARENT_ID_SALES_SHIPMENT_ENTITY_ID` FOREIGN KEY (`parent_id`) REFERENCES `sgp_sales_shipment` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sales_shipping_aggregated`
--
ALTER TABLE `sgp_sales_shipping_aggregated`
  ADD CONSTRAINT `SGP_SALES_SHIPPING_AGGREGATED_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_sales_shipping_aggregated_order`
--
ALTER TABLE `sgp_sales_shipping_aggregated_order`
  ADD CONSTRAINT `SGP_SALES_SHIPPING_AGGREGATED_ORDER_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL;

--
-- Constraints for table `sgp_search_query`
--
ALTER TABLE `sgp_search_query`
  ADD CONSTRAINT `SGP_SEARCH_QUERY_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_search_synonyms`
--
ALTER TABLE `sgp_search_synonyms`
  ADD CONSTRAINT `SGP_SEARCH_SYNONYMS_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_SEARCH_SYNONYMS_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_sitemap`
--
ALTER TABLE `sgp_sitemap`
  ADD CONSTRAINT `SGP_SITEMAP_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_store`
--
ALTER TABLE `sgp_store`
  ADD CONSTRAINT `SGP_STORE_GROUP_ID_STORE_GROUP_GROUP_ID` FOREIGN KEY (`group_id`) REFERENCES `sgp_store_group` (`group_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_STORE_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_store_group`
--
ALTER TABLE `sgp_store_group`
  ADD CONSTRAINT `SGP_STORE_GROUP_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_tax_calculation`
--
ALTER TABLE `sgp_tax_calculation`
  ADD CONSTRAINT `SGP_TAX_CALCULATION_CUSTOMER_TAX_CLASS_ID_TAX_CLASS_CLASS_ID` FOREIGN KEY (`customer_tax_class_id`) REFERENCES `sgp_tax_class` (`class_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_TAX_CALCULATION_PRODUCT_TAX_CLASS_ID_TAX_CLASS_CLASS_ID` FOREIGN KEY (`product_tax_class_id`) REFERENCES `sgp_tax_class` (`class_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_TAX_CALC_TAX_CALC_RATE_ID_TAX_CALC_RATE_TAX_CALC_RATE_ID` FOREIGN KEY (`tax_calculation_rate_id`) REFERENCES `sgp_tax_calculation_rate` (`tax_calculation_rate_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_TAX_CALC_TAX_CALC_RULE_ID_TAX_CALC_RULE_TAX_CALC_RULE_ID` FOREIGN KEY (`tax_calculation_rule_id`) REFERENCES `sgp_tax_calculation_rule` (`tax_calculation_rule_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_tax_calculation_rate_title`
--
ALTER TABLE `sgp_tax_calculation_rate_title`
  ADD CONSTRAINT `FK_EE62B972F5C70C47BB32B4A17442CB2C` FOREIGN KEY (`tax_calculation_rate_id`) REFERENCES `sgp_tax_calculation_rate` (`tax_calculation_rate_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_TAX_CALCULATION_RATE_TITLE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_tax_order_aggregated_created`
--
ALTER TABLE `sgp_tax_order_aggregated_created`
  ADD CONSTRAINT `SGP_TAX_ORDER_AGGREGATED_CREATED_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_tax_order_aggregated_updated`
--
ALTER TABLE `sgp_tax_order_aggregated_updated`
  ADD CONSTRAINT `SGP_TAX_ORDER_AGGREGATED_UPDATED_STORE_ID_SGP_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_theme_file`
--
ALTER TABLE `sgp_theme_file`
  ADD CONSTRAINT `SGP_THEME_FILE_THEME_ID_THEME_THEME_ID` FOREIGN KEY (`theme_id`) REFERENCES `sgp_theme` (`theme_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_translation`
--
ALTER TABLE `sgp_translation`
  ADD CONSTRAINT `SGP_TRANSLATION_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_ui_bookmark`
--
ALTER TABLE `sgp_ui_bookmark`
  ADD CONSTRAINT `SGP_UI_BOOKMARK_USER_ID_ADMIN_USER_USER_ID` FOREIGN KEY (`user_id`) REFERENCES `sgp_admin_user` (`user_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_variable_value`
--
ALTER TABLE `sgp_variable_value`
  ADD CONSTRAINT `SGP_VARIABLE_VALUE_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_VARIABLE_VALUE_VARIABLE_ID_VARIABLE_VARIABLE_ID` FOREIGN KEY (`variable_id`) REFERENCES `sgp_variable` (`variable_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_vault_payment_token`
--
ALTER TABLE `sgp_vault_payment_token`
  ADD CONSTRAINT `SGP_VAULT_PAYMENT_TOKEN_CSTR_ID_SGP_CSTR_ENTT_ENTT_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_vault_payment_token_order_payment_link`
--
ALTER TABLE `sgp_vault_payment_token_order_payment_link`
  ADD CONSTRAINT `FK_5363E50328E89D2B15721AEFB1F17852` FOREIGN KEY (`order_payment_id`) REFERENCES `sgp_sales_order_payment` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_A42F90DF4FCEFCBBB25F3845780DE120` FOREIGN KEY (`payment_token_id`) REFERENCES `sgp_vault_payment_token` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_weee_tax`
--
ALTER TABLE `sgp_weee_tax`
  ADD CONSTRAINT `SGP_WEEE_TAX_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `sgp_eav_attribute` (`attribute_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_WEEE_TAX_COUNTRY_DIRECTORY_COUNTRY_COUNTRY_ID` FOREIGN KEY (`country`) REFERENCES `sgp_directory_country` (`country_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_WEEE_TAX_ENTITY_ID_CATALOG_PRODUCT_ENTITY_ENTITY_ID` FOREIGN KEY (`entity_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_WEEE_TAX_WEBSITE_ID_STORE_WEBSITE_WEBSITE_ID` FOREIGN KEY (`website_id`) REFERENCES `sgp_store_website` (`website_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_widget_instance`
--
ALTER TABLE `sgp_widget_instance`
  ADD CONSTRAINT `SGP_WIDGET_INSTANCE_THEME_ID_THEME_THEME_ID` FOREIGN KEY (`theme_id`) REFERENCES `sgp_theme` (`theme_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_widget_instance_page`
--
ALTER TABLE `sgp_widget_instance_page`
  ADD CONSTRAINT `SGP_WIDGET_INSTANCE_PAGE_INSTANCE_ID_WIDGET_INSTANCE_INSTANCE_ID` FOREIGN KEY (`instance_id`) REFERENCES `sgp_widget_instance` (`instance_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_widget_instance_page_layout`
--
ALTER TABLE `sgp_widget_instance_page_layout`
  ADD CONSTRAINT `FK_12DD2F70B05DB0A5625EA8D932D6CD39` FOREIGN KEY (`layout_update_id`) REFERENCES `sgp_layout_update` (`layout_update_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `FK_572A8A8B31A0A1ABCEED05DFCFDE50FA` FOREIGN KEY (`page_id`) REFERENCES `sgp_widget_instance_page` (`page_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_wishlist`
--
ALTER TABLE `sgp_wishlist`
  ADD CONSTRAINT `SGP_WISHLIST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `sgp_customer_entity` (`entity_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_wishlist_item`
--
ALTER TABLE `sgp_wishlist_item`
  ADD CONSTRAINT `SGP_WISHLIST_ITEM_PRODUCT_ID_CATALOG_PRODUCT_ENTITY_ENTITY_ID` FOREIGN KEY (`product_id`) REFERENCES `sgp_catalog_product_entity` (`entity_id`) ON DELETE CASCADE,
  ADD CONSTRAINT `SGP_WISHLIST_ITEM_STORE_ID_STORE_STORE_ID` FOREIGN KEY (`store_id`) REFERENCES `sgp_store` (`store_id`) ON DELETE SET NULL,
  ADD CONSTRAINT `SGP_WISHLIST_ITEM_WISHLIST_ID_WISHLIST_WISHLIST_ID` FOREIGN KEY (`wishlist_id`) REFERENCES `sgp_wishlist` (`wishlist_id`) ON DELETE CASCADE;

--
-- Constraints for table `sgp_wishlist_item_option`
--
ALTER TABLE `sgp_wishlist_item_option`
  ADD CONSTRAINT `FK_6D0395ED797D12607FBC084E3D0B8C0F` FOREIGN KEY (`wishlist_item_id`) REFERENCES `sgp_wishlist_item` (`wishlist_item_id`) ON DELETE CASCADE;
COMMIT;

