|
Salve,
Prima ti tutto vi faccio i miei compliementi per questa comunità. Ho da poco incominciato ad usare Magento e leggere questo forum mi è stato molto utile per risolrvere i vari problemi.
Ho creato un sito locale e ora è il momento di caricarlo online, ho caricato tutto via FTP, dopodichè ho esportato il db locale in .sql,
quando è stata ora di importarlo, phpMyAdmin mi ha riportato questo errore:
--
-- Limiti per la tabella `eav_attribute`
--
ALTER TABLE `eav_attribute` ADD CONSTRAINT `FK_EAV_ATTRIBUTE_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID` FOREIGN KEY ( `entity_type_id` ) REFERENCES `eav_entity_type` ( `entity_type_id` ) ON DELETE CASCADE ON UPDATE CASCADE ;
Messaggio di MySQL:
#1452 - Cannot add or update a child row: a foreign key constraint fails (`fcamilu_magento/#sql-6a8f_b643a4`, CONSTRAINT `FK_EAV_ATTRIBUTE_ENTITY_TYPE_ID_EAV_ENTITY_TYPE_ENTITY_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) O)
Mi sono informato, e da quello che ho capito (Ma non ne sono sicuro), è perché c’è una chiave esterna che fa riferimento a una chiave interna che non esiste. Ma se fosse così non so proprio cosa fare…
P.S.: Ho provato, a commentare nell’ sql la query che restituiva l’errore, per vedere se ci fossero altri problemi, e le altre query che mi hanno dato lo stesso problema sono state:
ALTER TABLE `eav_attribute_group`
ADD CONSTRAINT `FK_EAV_ATTR_GROUP_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribute_set_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `eav_attribute_set`
ADD CONSTRAINT `FK_EAV_ATTR_SET_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `eav_attribute_set` ADD CONSTRAINT `FK_EAV_ATTR_SET_ENTT_TYPE_ID_EAV_ENTT_TYPE_ENTT_TYPE_ID` FOREIGN KEY (`entity_type_id`) REFERENCES `eav_entity_type` (`entity_type_id`) ON DELETE CASCADE ON UPDATE CASCADE;*/
ALTER TABLE `eav_entity_attribute`
ADD CONSTRAINT `FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_EAV_ENTT_ATTR_ATTR_GROUP_ID_EAV_ATTR_GROUP_ATTR_GROUP_ID` FOREIGN KEY (`attribute_group_id`) REFERENCES `eav_attribute_group` (`attribute_group_id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `tag`
ADD CONSTRAINT `FK_TAG_FIRST_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`first_customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE SET NULL ON UPDATE NO ACTION,
ADD CONSTRAINT `FK_TAG_FIRST_STORE_ID_CORE_STORE_STORE_ID` FOREIGN KEY (`first_store_id`) REFERENCES `core_store` (`store_id`) ON DELETE SET NULL ON UPDATE NO ACTION;
Probabilmente quest’ultime hanno restituito errore perché mancava quella sopra, penso.
Sapete per caso a cos’è dovuto e come è possibile risolverlo?
Grazie!
|