【发布时间】:2015-11-04 15:29:47
【问题描述】:
我需要使用插件的设置脚本更改 magento 中的默认 customer_entity 表描述,是否可以删除 UNIQUE KEY 字段?
magentocustomer_entity表结构描述为:
CREATE TABLE `customer_entity` (
`entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Entity Id',
`entity_type_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Entity Type Id',
`attribute_set_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Attribute Set Id',
`website_id` smallint(5) unsigned DEFAULT NULL COMMENT 'Website Id',
`email` varchar(255) DEFAULT NULL COMMENT 'Email',
...
UNIQUE KEY `UNQ_CUSTOMER_ENTITY_EMAIL_WEBSITE_ID` (`email`,`website_id`),
...
所以我需要用安装脚本让它删除这个
UNIQUE KEY `UNQ_CUSTOMER_ENTITY_EMAIL_WEBSITE_ID` (`email`,`website_id`)
【问题讨论】:
-
究竟是什么问题?您不能从脚本中删除该行吗?
-
根据 magento 参考,应该使用安装脚本而不是 sql,我上面提供的代码只是描述表的转储
标签: mysql magento magento-1.9