次のエラーが発生します。
SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`catalog_product_entity_tier_price`, CONSTRAINT `FK_6E08D719F0501DD1D8E6D4EFF2511C85` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DEL)
これを修正する方法がわかりません。何か助けて????
データベースを確認すると、customer_group には他の magento インストールと同じように 4 つの行があり、catalog_product_entity_tier_price は完全に空です。
customer_group テーブル ダンプ:
CREATE TABLE IF NOT EXISTS `customer_group` (
`customer_group_id` smallint(5) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Customer Group Id',
`customer_group_code` varchar(32) NOT NULL COMMENT 'Customer Group Code',
`tax_class_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Tax Class Id',
PRIMARY KEY (`customer_group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Customer Group' AUTO_INCREMENT=5 ;
--
-- Dumping data for table `customer_group`
--
INSERT INTO `customer_group` (`customer_group_id`, `customer_group_code`, `tax_class_id`) VALUES
(1, 'General', 3),
(2, 'Wholesale', 3),
(3, 'Retailer', 3),
(4, 'NOT LOGGED IN', 3);
catalog_product_entity_tier_price ダンプ:
--
-- Table structure for table `catalog_product_entity_tier_price`
--
CREATE TABLE IF NOT EXISTS `catalog_product_entity_tier_price` (
`value_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Value ID',
`entity_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT 'Entity ID',
`all_groups` smallint(5) unsigned NOT NULL DEFAULT '1' COMMENT 'Is Applicable To All Customer Groups',
`customer_group_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Customer Group ID',
`qty` decimal(12,4) NOT NULL DEFAULT '1.0000' COMMENT 'QTY',
`value` decimal(12,4) NOT NULL DEFAULT '0.0000' COMMENT 'Value',
`website_id` smallint(5) unsigned NOT NULL DEFAULT '0' COMMENT 'Website ID',
PRIMARY KEY (`value_id`),
UNIQUE KEY `E8AB433B9ACB00343ABB312AD2FAB087` (`entity_id`,`all_groups`,`customer_group_id`,`qty`,`website_id`),
KEY `IDX_CATALOG_PRODUCT_ENTITY_TIER_PRICE_ENTITY_ID` (`entity_id`),
KEY `IDX_CATALOG_PRODUCT_ENTITY_TIER_PRICE_CUSTOMER_GROUP_ID` (`customer_group_id`),
KEY `IDX_CATALOG_PRODUCT_ENTITY_TIER_PRICE_WEBSITE_ID` (`website_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog Product Tier Price Attribute Backend Table' AUTO_INCREMENT=4 ;
--
-- Constraints for dumped tables
--
--
-- Constraints for table `catalog_product_entity_tier_price`
--
ALTER TABLE `catalog_product_entity_tier_price`
ADD CONSTRAINT `FK_6E08D719F0501DD1D8E6D4EFF2511C85` FOREIGN KEY (`customer_group_id`) REFERENCES `customer_group` (`customer_group_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_CAT_PRD_ENTT_TIER_PRICE_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_CAT_PRD_ENTT_TIER_PRICE_WS_ID_CORE_WS_WS_ID` FOREIGN KEY (`website_id`) REFERENCES `core_website` (`website_id`) ON DELETE CASCADE ON UPDATE CASCADE;
この問題を解決する方法を教えてください。(magento 1.7.0.2 を使用)
ありがとうございました。