# No mapping found for field 'customerAddress' trotz ForeignKey-Reparatur

**URL:** <https://forum.shopware.com/t/no-mapping-found-for-field-customeraddress-trotz-foreignkey-reparatur/39489>\
**Category:** Administration\
**Created:** [1. September 2016 um 11:29 UTC](https://forum.shopware.com/t/no-mapping-found-for-field-customeraddress-trotz-foreignkey-reparatur/39489 "2016-09-01T11:29:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![sigmastern](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@sigmastern](https://forum.shopware.com/u/sigmastern)\
**Post date:** [1. September 2016 um 11:29 UTC](https://forum.shopware.com/t/no-mapping-found-for-field-customeraddress-trotz-foreignkey-reparatur/39489/1 "2016-09-01T11:29:07Z")

</div>

\*update\* &nbsp;inzwischen erledigt.

Einige Constraints in der Datenbank haben nach Serverumzug gefehlt. Danach ließen sich alle Proxys wieder neu generieren.

---

<div class="post-metadata">

**Author:** ![Tammo](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@Tammo](https://forum.shopware.com/u/Tammo)\
**Post date:** [21. September 2016 um 09:42 UTC](https://forum.shopware.com/t/no-mapping-found-for-field-customeraddress-trotz-foreignkey-reparatur/39489/2 "2016-09-21T09:42:17Z")

</div>

Kannst du vllt sagen wie du das Problem behoben hast? habe das gleiche problem aktuell

---

<div class="post-metadata">

**Author:** ![sigmastern](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@sigmastern](https://forum.shopware.com/u/sigmastern)\
**Post date:** [21. September 2016 um 09:47 UTC](https://forum.shopware.com/t/no-mapping-found-for-field-customeraddress-trotz-foreignkey-reparatur/39489/3 "2016-09-21T09:47:53Z")

</div>

Hallo Tammo,

mach am besten ein Backup deiner jetzigen Datenbank.

&nbsp;

Bei mir war es so, dass beim Datenbankumzug die CONSTRAINTS schon im Export gefehlt haben.

Mit folgenden SQL-Queries konnte ich die (aus einer anderen Installation) wieder hinzufügen… Wie gesagt: vorher Backup machen. &nbsp;

TEIL 1:

– Constraints der exportierten Tabellen

– Constraints der Tabelle `s_articles_attributes`  
ALTER TABLE `s_articles_attributes`  
&nbsp; ADD CONSTRAINT `s_articles_attributes_ibfk_1` FOREIGN KEY (`articleID`) REFERENCES `s_articles` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,  
&nbsp; ADD CONSTRAINT `s_articles_attributes_ibfk_2` FOREIGN KEY (`articledetailsID`) REFERENCES `s_articles_details` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_articles_downloads_attributes`  
ALTER TABLE `s_articles_downloads_attributes`  
&nbsp; ADD CONSTRAINT `s_articles_downloads_attributes_ibfk_1` FOREIGN KEY (`downloadID`) REFERENCES `s_articles_downloads` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_articles_esd_attributes`  
ALTER TABLE `s_articles_esd_attributes`  
&nbsp; ADD CONSTRAINT `s_articles_esd_attributes_ibfk_1` FOREIGN KEY (`esdID`) REFERENCES `s_articles_esd` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_articles_img_attributes`  
ALTER TABLE `s_articles_img_attributes`  
&nbsp; ADD CONSTRAINT `s_articles_img_attributes_ibfk_1` FOREIGN KEY (`imageID`) REFERENCES `s_articles_img` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_articles_information_attributes`  
ALTER TABLE `s_articles_information_attributes`  
&nbsp; ADD CONSTRAINT `s_articles_information_attributes_ibfk_1` FOREIGN KEY (`informationID`) REFERENCES `s_articles_information` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_articles_prices_attributes`  
ALTER TABLE `s_articles_prices_attributes`  
&nbsp; ADD CONSTRAINT `s_articles_prices_attributes_ibfk_1` FOREIGN KEY (`priceID`) REFERENCES `s_articles_prices` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_articles_supplier_attributes`  
ALTER TABLE `s_articles_supplier_attributes`  
&nbsp; ADD CONSTRAINT `s_articles_supplier_attributes_ibfk_1` FOREIGN KEY (`supplierID`) REFERENCES `s_articles_supplier` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_article_configurator_templates_attributes`  
ALTER TABLE `s_article_configurator_templates_attributes`  
&nbsp; ADD CONSTRAINT `s_article_configurator_templates_attributes_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `s_article_configurator_templates` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_article_configurator_template_prices_attributes`  
ALTER TABLE `s_article_configurator_template_prices_attributes`  
&nbsp; ADD CONSTRAINT `s_article_configurator_template_prices_attributes_ibfk_1` FOREIGN KEY (`template_price_id`) REFERENCES `s_article_configurator_template_prices` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_blog_attributes`  
ALTER TABLE `s_blog_attributes`  
&nbsp; ADD CONSTRAINT `s_blog_attributes_ibfk_1` FOREIGN KEY (`blog_id`) REFERENCES `s_blog` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_categories`  
ALTER TABLE `s_categories`  
&nbsp; ADD CONSTRAINT `s_categories_fk_stream_id` FOREIGN KEY (`stream_id`) REFERENCES `s_product_streams` (`id`) ON DELETE SET NULL;

– Constraints der Tabelle `s_categories_attributes`  
ALTER TABLE `s_categories_attributes`  
&nbsp; ADD CONSTRAINT `s_categories_attributes_ibfk_1` FOREIGN KEY (`categoryID`) REFERENCES `s_categories` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_cms_static_attributes`  
ALTER TABLE `s_cms_static_attributes`  
&nbsp; ADD CONSTRAINT `s_cms_static_attributes_ibfk_1` FOREIGN KEY (`cmsStaticID`) REFERENCES `s_cms_static` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_cms_support_attributes`  
ALTER TABLE `s_cms_support_attributes`  
&nbsp; ADD CONSTRAINT `s_cms_support_attributes_ibfk_1` FOREIGN KEY (`cmsSupportID`) REFERENCES `s_cms_support` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_core_auth_attributes`  
ALTER TABLE `s_core_auth_attributes`  
&nbsp; ADD CONSTRAINT `s_core_auth_attributes_ibfk_1` FOREIGN KEY (`authID`) REFERENCES `s_core_auth` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_core_config_mails`  
ALTER TABLE `s_core_config_mails`  
&nbsp; ADD CONSTRAINT `s_core_config_mails_ibfk_1` FOREIGN KEY (`stateId`) REFERENCES `s_core_states` (`id`);

– Constraints der Tabelle `s_core_config_mails_attributes`  
ALTER TABLE `s_core_config_mails_attributes`  
&nbsp; ADD CONSTRAINT `s_core_config_mails_attributes_ibfk_1` FOREIGN KEY (`mailID`) REFERENCES `s_core_config_mails` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_core_countries_attributes`  
ALTER TABLE `s_core_countries_attributes`  
&nbsp; ADD CONSTRAINT `s_core_countries_attributes_ibfk_1` FOREIGN KEY (`countryID`) REFERENCES `s_core_countries` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_core_countries_states_attributes`  
ALTER TABLE `s_core_countries_states_attributes`  
&nbsp; ADD CONSTRAINT `s_core_countries_states_attributes_ibfk_1` FOREIGN KEY (`stateID`) REFERENCES `s_core_countries_states` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_core_customergroups_attributes`  
ALTER TABLE `s_core_customergroups_attributes`  
&nbsp; ADD CONSTRAINT `s_core_customergroups_attributes_ibfk_1` FOREIGN KEY (`customerGroupID`) REFERENCES `s_core_customergroups` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_core_paymentmeans_attributes`  
ALTER TABLE `s_core_paymentmeans_attributes`  
&nbsp; ADD CONSTRAINT `s_core_paymentmeans_attributes_ibfk_1` FOREIGN KEY (`paymentmeanID`) REFERENCES `s_core_paymentmeans` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_emarketing_banners_attributes`  
ALTER TABLE `s_emarketing_banners_attributes`  
&nbsp; ADD CONSTRAINT `s_emarketing_banners_attributes_ibfk_1` FOREIGN KEY (`bannerID`) REFERENCES `s_emarketing_banners` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_emarketing_vouchers_attributes`  
ALTER TABLE `s_emarketing_vouchers_attributes`  
&nbsp; ADD CONSTRAINT `s_emarketing_vouchers_attributes_ibfk_1` FOREIGN KEY (`voucherID`) REFERENCES `s_emarketing_vouchers` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_emotion_attributes`  
ALTER TABLE `s_emotion_attributes`  
&nbsp; ADD CONSTRAINT `s_emotion_attributes_ibfk_1` FOREIGN KEY (`emotionID`) REFERENCES `s_emotion` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_export_attributes`  
ALTER TABLE `s_export_attributes`  
&nbsp; ADD CONSTRAINT `s_export_attributes_ibfk_1` FOREIGN KEY (`exportID`) REFERENCES `s_export` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_filter_attributes`  
ALTER TABLE `s_filter_attributes`  
&nbsp; ADD CONSTRAINT `s_filter_attributes_ibfk_1` FOREIGN KEY (`filterID`) REFERENCES `s_filter` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_filter_options_attributes`  
ALTER TABLE `s_filter_options_attributes`  
&nbsp; ADD CONSTRAINT `s_filter_options_attributes_ibfk_1` FOREIGN KEY (`optionID`) REFERENCES `s_filter_options` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_filter_values_attributes`  
ALTER TABLE `s_filter_values_attributes`  
&nbsp; ADD CONSTRAINT `s_filter_values_attributes_ibfk_1` FOREIGN KEY (`valueID`) REFERENCES `s_filter_values` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_import_export_expression`  
ALTER TABLE `s_import_export_expression`  
&nbsp; ADD CONSTRAINT `FK_42CE4B73CCFA12B8` FOREIGN KEY (`profile_id`) REFERENCES `s_import_export_profile` (`id`) ON DELETE CASCADE;

– Constraints der Tabelle `s_import_export_session`  
ALTER TABLE `s_import_export_session`  
&nbsp; ADD CONSTRAINT `FK_64E921BACCFA12B8` FOREIGN KEY (`profile_id`) REFERENCES `s_import_export_profile` (`id`) ON DELETE CASCADE;

– Constraints der Tabelle `s_media_attributes`  
ALTER TABLE `s_media_attributes`  
&nbsp; ADD CONSTRAINT `s_media_attributes_ibfk_1` FOREIGN KEY (`mediaID`) REFERENCES `s_media` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_multi_edit_queue_articles`  
ALTER TABLE `s_multi_edit_queue_articles`  
&nbsp; ADD CONSTRAINT `s_multi_edit_queue_articles_ibfk_1` FOREIGN KEY (`detail_id`) REFERENCES `s_articles_details` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION,  
&nbsp; ADD CONSTRAINT `s_multi_edit_queue_articles_ibfk_2` FOREIGN KEY (`queue_id`) REFERENCES `s_multi_edit_queue` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;  
&nbsp;

---

<div class="post-metadata">

**Author:** ![sigmastern](https://avatars.discourse-cdn.com/v4/letter/s/bb73d2/32.png) [@sigmastern](https://forum.shopware.com/u/sigmastern)\
**Post date:** [21. September 2016 um 09:48 UTC](https://forum.shopware.com/t/no-mapping-found-for-field-customeraddress-trotz-foreignkey-reparatur/39489/4 "2016-09-21T09:48:09Z")

</div>

und Teil 2:

&nbsp;

– Constraints der Tabelle `s_order_attributes`  
ALTER TABLE `s_order_attributes`  
&nbsp; ADD CONSTRAINT `s_order_attributes_ibfk_1` FOREIGN KEY (`orderID`) REFERENCES `s_order` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_order_basket_attributes`  
ALTER TABLE `s_order_basket_attributes`  
&nbsp; ADD CONSTRAINT `s_order_basket_attributes_ibfk_2` FOREIGN KEY (`basketID`) REFERENCES `s_order_basket` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_order_billingaddress_attributes`  
ALTER TABLE `s_order_billingaddress_attributes`  
&nbsp; ADD CONSTRAINT `s_order_billingaddress_attributes_ibfk_2` FOREIGN KEY (`billingID`) REFERENCES `s_order_billingaddress` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_order_details_attributes`  
ALTER TABLE `s_order_details_attributes`  
&nbsp; ADD CONSTRAINT `s_order_details_attributes_ibfk_1` FOREIGN KEY (`detailID`) REFERENCES `s_order_details` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_order_documents_attributes`  
ALTER TABLE `s_order_documents_attributes`  
&nbsp; ADD CONSTRAINT `s_order_documents_attributes_ibfk_1` FOREIGN KEY (`documentID`) REFERENCES `s_order_documents` (`ID`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_order_shippingaddress_attributes`  
ALTER TABLE `s_order_shippingaddress_attributes`  
&nbsp; ADD CONSTRAINT `s_order_shippingaddress_attributes_ibfk_1` FOREIGN KEY (`shippingID`) REFERENCES `s_order_shippingaddress` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_premium_dispatch_attributes`  
ALTER TABLE `s_premium_dispatch_attributes`  
&nbsp; ADD CONSTRAINT `s_premium_dispatch_attributes_ibfk_1` FOREIGN KEY (`dispatchID`) REFERENCES `s_premium_dispatch` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_product_streams_articles`  
ALTER TABLE `s_product_streams_articles`  
&nbsp; ADD CONSTRAINT `s_product_streams_articles_fk_article_id` FOREIGN KEY (`article_id`) REFERENCES `s_articles` (`id`) ON DELETE CASCADE,  
&nbsp; ADD CONSTRAINT `s_product_streams_articles_fk_stream_id` FOREIGN KEY (`stream_id`) REFERENCES `s_product_streams` (`id`) ON DELETE CASCADE;

– Constraints der Tabelle `s_product_streams_attributes`  
ALTER TABLE `s_product_streams_attributes`  
&nbsp; ADD CONSTRAINT `s_product_streams_attributes_ibfk_1` FOREIGN KEY (`streamID`) REFERENCES `s_product_streams` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_product_streams_selection`  
ALTER TABLE `s_product_streams_selection`  
&nbsp; ADD CONSTRAINT `s_product_streams_selection_fk_article_id` FOREIGN KEY (`article_id`) REFERENCES `s_articles` (`id`) ON DELETE CASCADE,  
&nbsp; ADD CONSTRAINT `s_product_streams_selection_fk_stream_id` FOREIGN KEY (`stream_id`) REFERENCES `s_product_streams` (`id`) ON DELETE CASCADE;

– Constraints der Tabelle `s_user_addresses`  
ALTER TABLE `s_user_addresses`  
&nbsp; ADD CONSTRAINT `s_user_addresses_ibfk_1` FOREIGN KEY (`country_id`) REFERENCES `s_core_countries` (`id`) ON UPDATE CASCADE,  
&nbsp; ADD CONSTRAINT `s_user_addresses_ibfk_2` FOREIGN KEY (`state_id`) REFERENCES `s_core_countries_states` (`id`) ON DELETE SET NULL ON UPDATE CASCADE,  
&nbsp; ADD CONSTRAINT `s_user_addresses_ibfk_3` FOREIGN KEY (`user_id`) REFERENCES `s_user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;

– Constraints der Tabelle `s_user_addresses_attributes`  
ALTER TABLE `s_user_addresses_attributes`  
&nbsp; ADD CONSTRAINT `s_user_addresses_attributes_ibfk_1` FOREIGN KEY (`address_id`) REFERENCES `s_user_addresses` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_user_attributes`  
ALTER TABLE `s_user_attributes`  
&nbsp; ADD CONSTRAINT `s_user_attributes_ibfk_1` FOREIGN KEY (`userID`) REFERENCES `s_user` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_user_billingaddress_attributes`  
ALTER TABLE `s_user_billingaddress_attributes`  
&nbsp; ADD CONSTRAINT `s_user_billingaddress_attributes_ibfk_1` FOREIGN KEY (`billingID`) REFERENCES `s_user_billingaddress` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;

– Constraints der Tabelle `s_user_shippingaddress_attributes`  
ALTER TABLE `s_user_shippingaddress_attributes`  
&nbsp; ADD CONSTRAINT `s_user_shippingaddress_attributes_ibfk_1` FOREIGN KEY (`shippingID`) REFERENCES `s_user_shippingaddress` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION;  
&nbsp;
