· 9 years ago · Nov 08, 2016, 01:56 PM
1SET FOREIGN_KEY_CHECKS=0;
2DROP TABLE IF EXISTS `core_store`;
3
4CREATE TABLE `core_store` (
5 `store_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Store Id',
6 `code` varchar(32) DEFAULT NULL COMMENT 'Code',
7 `website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website Id',
8 `group_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Group Id',
9 `name` varchar(255) NOT NULL COMMENT 'Store Name',
10 `sort_order` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Sort Order',
11 `is_active` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Store Activity',
12 PRIMARY KEY (`store_id`),
13 UNIQUE KEY `UNQ_CORE_STORE_CODE` (`code`),
14 KEY `IDX_CORE_STORE_WEBSITE_ID` (`website_id`),
15 KEY `IDX_CORE_STORE_IS_ACTIVE_SORT_ORDER` (`is_active`,`sort_order`),
16 KEY `IDX_CORE_STORE_GROUP_ID` (`group_id`)
17) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Stores';
18
19LOCK TABLES `core_store` WRITE;
20/*!40000 ALTER TABLE `core_store` DISABLE KEYS */;
21
22INSERT INTO `core_store` (`store_id`, `code`, `website_id`, `group_id`, `name`, `sort_order`, `is_active`)
23VALUES
24(1,'admin',0,0,'Admin',0,1),
25(2,'store',1,1,'Store',0,1);
26
27UPDATE `core_store` SET `store_id` = '0' WHERE `store_id` = '1' COLLATE utf8_bin LIMIT 1;
28
29UPDATE `core_store` SET `store_id` = '1' WHERE `store_id` = '2' COLLATE utf8_bin LIMIT 1;
30
31/*!40000 ALTER TABLE `core_store` ENABLE KEYS */;
32UNLOCK TABLES;