Created
November 8, 2016 09:08
-
-
Save artttj/1da4bdb317c140a3d286e971a5acafe9 to your computer and use it in GitHub Desktop.
Duplicate entry '1' for key 'PRIMARY' in data migration in Magento
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET FOREIGN_KEY_CHECKS=0; | |
DROP TABLE IF EXISTS `core_store`; | |
CREATE TABLE `core_store` ( | |
`store_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Store Id', | |
`code` varchar(32) DEFAULT NULL COMMENT 'Code', | |
`website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website Id', | |
`group_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Group Id', | |
`name` varchar(255) NOT NULL COMMENT 'Store Name', | |
`sort_order` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Sort Order', | |
`is_active` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Activity', | |
PRIMARY KEY (`store_id`), | |
UNIQUE KEY `UNQ_CORE_STORE_CODE` (`code`), | |
KEY `IDX_CORE_STORE_WEBSITE_ID` (`website_id`), | |
KEY `IDX_CORE_STORE_IS_ACTIVE_SORT_ORDER` (`is_active`,`sort_order`), | |
KEY `IDX_CORE_STORE_GROUP_ID` (`group_id`) | |
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores'; | |
LOCK TABLES `core_store` WRITE; | |
/*!40000 ALTER TABLE `core_store` DISABLE KEYS */; | |
INSERT INTO `core_store` (`store_id`, `code`, `website_id`, `group_id`, `name`, `sort_order`, `is_active`) | |
VALUES | |
(1,'admin',0,0,'Admin',0,1), | |
(2,'store',1,1,'Store',0,1); | |
UPDATE `core_store` SET `store_id` = '0' WHERE `store_id` = '1' COLLATE utf8_bin LIMIT 1; | |
UPDATE `core_store` SET `store_id` = '1' WHERE `store_id` = '2' COLLATE utf8_bin LIMIT 1; | |
/*!40000 ALTER TABLE `core_store` ENABLE KEYS */; | |
UNLOCK TABLES; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment