# Repair Foreign Keys läuft nicht durch - Fehlermeldung

**URL:** <https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816>\
**Category:** Allgemein\
**Created:** [21. Januar 2016 um 23:18 UTC](https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816 "2016-01-21T23:18:19Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![kweb](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@kweb](https://forum.shopware.com/u/kweb)\
**Post date:** [21. Januar 2016 um 23:18 UTC](https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816/1 "2016-01-21T23:18:19Z")

</div>

Hallo, in eienm Shop habe ich den Fall, dass ich scheinbar das Script Repair Foreign Keys einsetzen muss, damit es beim Update auf die neuste Shopware Version nicht zu Fehlern kommt. Jetzt habe ich aber das Problem, dass das Script nicht durchläuft im PHPMyAdmin des Shops. Ich erhalte nach ca. 15 Sekunden diese Fehlermeldung: `SQL-Befehl: -- Add missing foreign key ALTER TABLE `s_article_configurator_template_prices_attributes` ADD FOREIGN KEY ( `template_price_id` ) REFERENCES `s_article_configurator_template_prices` ( `id` ) ON DELETE CASCADE ON UPDATE NO ACTION ; MySQL meldet: Dokumentation #1005 - Can't create table 'd0206f09.#sql-8b8\_9dbed' (errno: 150) (Details...) ` Ich habe absolut keinen Plan was diese Fehlermeldung zu bedeuten hat. “Cant create table” - verstehe ich nicht - es soll doch gar keine neue Tabelle angelegt werden. Kann mir bitte wer helfen? Gruß kweb

---

<div class="post-metadata">

**Author:** ![kweb](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@kweb](https://forum.shopware.com/u/kweb)\
**Post date:** [22. Januar 2016 um 18:47 UTC](https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816/2 "2016-01-22T18:47:08Z")

</div>

\*push\* Niemand eine Idee? 😕

---

<div class="post-metadata">

**Author:** ![Moritz\_Naczenski](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/moritz_naczenski/32/7792_2.png) [@Moritz\_Naczenski](https://forum.shopware.com/u/Moritz_Naczenski)\
**Post date:** [22. Januar 2016 um 20:06 UTC](https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816/3 "2016-01-22T20:06:35Z")

</div>

Hallo, die Fehlermeldung ist typisch wenn Mysql/die Serverkonfiguration das Erstellen von temporären Tabellen unterbindet. Der Fehler hat erstmal nichts mit den Foreign Keys oder dem Script an sich zu tun. Du solltest auch keine Tabellen die auf \_attributes in der Datenbank haben, die Shopware nicht kennt. Oftmals haben viele Kunden sowas wie bck\_xyz\_attributes in der Datenbank - also Backup-Tabellen. Die können auch zu solchen Problemen führen. Moritz

---

<div class="post-metadata">

**Author:** ![kweb](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@kweb](https://forum.shopware.com/u/kweb)\
**Post date:** [25. Januar 2016 um 10:22 UTC](https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816/4 "2016-01-25T10:22:43Z")

</div>

[quote=“Moritz Naczenski”]Hallo, die Fehlermeldung ist typisch wenn Mysql/die Serverkonfiguration das Erstellen von temporären Tabellen unterbindet. Der Fehler hat erstmal nichts mit den Foreign Keys oder dem Script an sich zu tun. Du solltest auch keine Tabellen die auf \_attributes in der Datenbank haben, die Shopware nicht kennt. Oftmals haben viele Kunden sowas wie bck\_xyz\_attributes in der Datenbank - also Backup-Tabellen. Die können auch zu solchen Problemen führen. Moritz[/quote] Hallo Moritz, danke für Deine Hilfe. Ich habe tatsächlich eine Tabelle in der Datenbank die heißt: s\_article\_configurator\_template\_prices\_attributes\_backup Die kann ich einfach löschen? Gruß kweb

---

<div class="post-metadata">

**Author:** ![Thomas](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/thomas/32/8167_2.png) [@Thomas](https://forum.shopware.com/u/Thomas)\
**Post date:** [25. Januar 2016 um 20:03 UTC](https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816/5 "2016-01-25T20:03:44Z")

</div>

[quote=“kweb”] danke für Deine Hilfe. Ich habe tatsächlich eine Tabelle in der Datenbank die heißt: s\_article\_configurator\_template\_prices\_attributes\_backup Die kann ich einfach löschen? Gruß kweb[/quote] Si - die wird über das SQL Script angelegt um die Daten “zwischen” zu speichern. Gruß

---

<div class="post-metadata">

**Author:** ![kweb](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@kweb](https://forum.shopware.com/u/kweb)\
**Post date:** [26. Januar 2016 um 00:06 UTC](https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816/6 "2016-01-26T00:06:35Z")

</div>

Also die Backup Tabelle wird erstellt wenn ich versuche das Script auszuführen, was aufgrund des Fehlers nicht durchläuft. Wenn ich die Backup Tabelle lösche hat es leider keinen Einfluss - der Fehler besteht weiterhin. An der Serverkonfiguration liegt es wohl auch nicht. Ich habe 4-5 Shopware Shops auf dem Server liegen und bei anderen Shops läuft das Script ja auch durch. Hier mal eine Auflistung der Tabellen die ich in meiner DB habe. Irgendwas ungewöhlnliches dabei`? s\_addon\_premiums s\_articles s\_articles\_also\_bought\_ro s\_articles\_attributes s\_articles\_avoid\_customergroups s\_articles\_categories s\_articles\_categories\_ro s\_articles\_categories\_seo s\_articles\_details s\_articles\_downloads s\_articles\_downloads\_attributes s\_articles\_esd s\_articles\_esd\_attributes s\_articles\_esd\_serials s\_articles\_img s\_articles\_img\_attributes s\_articles\_information s\_articles\_information\_attributes s\_articles\_notification s\_articles\_prices s\_articles\_prices\_attributes s\_articles\_relationships s\_articles\_similar s\_articles\_similar\_shown\_ro s\_articles\_supplier s\_articles\_supplier\_attributes s\_articles\_top\_seller\_ro s\_articles\_translations s\_articles\_vote s\_article\_configurator\_dependencies s\_article\_configurator\_groups s\_article\_configurator\_options s\_article\_configurator\_option\_relations s\_article\_configurator\_price\_variations s\_article\_configurator\_sets s\_article\_configurator\_set\_group\_relations s\_article\_configurator\_set\_option\_relations s\_article\_configurator\_templates s\_article\_configurator\_templates\_attributes s\_article\_configurator\_template\_prices s\_article\_configurator\_template\_prices\_attributes s\_article\_configurator\_template\_prices\_attributes\_backup s\_article\_img\_mappings s\_article\_img\_mapping\_rules s\_billing\_template s\_blog s\_blog\_assigned\_articles s\_blog\_attributes s\_blog\_comments s\_blog\_media s\_blog\_tags s\_campaigns\_articles s\_campaigns\_banner s\_campaigns\_containers s\_campaigns\_groups s\_campaigns\_html s\_campaigns\_links s\_campaigns\_logs s\_campaigns\_mailaddresses s\_campaigns\_maildata s\_campaigns\_mailings s\_campaigns\_positions s\_campaigns\_sender s\_campaigns\_templates s\_categories s\_categories\_attributes s\_categories\_avoid\_customergroups s\_cms\_static s\_cms\_static\_attributes s\_cms\_static\_groups s\_cms\_support s\_cms\_support\_attributes s\_cms\_support\_fields s\_core\_acl\_privileges s\_core\_acl\_resources s\_core\_acl\_roles s\_core\_auth s\_core\_auth\_attributes s\_core\_auth\_roles s\_core\_config\_elements s\_core\_config\_element\_translations s\_core\_config\_forms s\_core\_config\_form\_translations s\_core\_config\_mails s\_core\_config\_mails\_attachments s\_core\_config\_mails\_attributes s\_core\_config\_values s\_core\_countries s\_core\_countries\_areas s\_core\_countries\_attributes s\_core\_countries\_states s\_core\_countries\_states\_attributes s\_core\_currencies s\_core\_customergroups s\_core\_customergroups\_attributes s\_core\_customergroups\_discounts s\_core\_customerpricegroups s\_core\_detail\_states s\_core\_documents s\_core\_documents\_box s\_core\_engine\_elements s\_core\_engine\_groups s\_core\_licenses s\_core\_locales s\_core\_log s\_core\_menu s\_core\_optin s\_core\_paymentmeans s\_core\_paymentmeans\_attributes s\_core\_paymentmeans\_countries s\_core\_paymentmeans\_subshops s\_core\_payment\_data s\_core\_payment\_instance s\_core\_plugins s\_core\_plugin\_categories s\_core\_pricegroups s\_core\_pricegroups\_discounts s\_core\_rewrite\_urls s\_core\_rulesets s\_core\_sessions s\_core\_sessions\_backend s\_core\_shops s\_core\_shop\_currencies s\_core\_shop\_pages s\_core\_snippets s\_core\_states s\_core\_subscribes s\_core\_tax s\_core\_tax\_rules s\_core\_templates s\_core\_templates\_config\_elements s\_core\_templates\_config\_layout s\_core\_templates\_config\_set s\_core\_templates\_config\_values s\_core\_theme\_settings s\_core\_translations s\_core\_units s\_core\_widgets s\_core\_widget\_views s\_crontab s\_emarketing\_banners s\_emarketing\_banners\_attributes s\_emarketing\_banners\_statistics s\_emarketing\_lastarticles s\_emarketing\_partner s\_emarketing\_referer s\_emarketing\_tellafriend s\_emarketing\_vouchers s\_emarketing\_vouchers\_attributes s\_emarketing\_voucher\_codes s\_emotion s\_emotion\_attributes s\_emotion\_categories s\_emotion\_element s\_emotion\_element\_value s\_emotion\_grid s\_emotion\_templates s\_es\_backlog s\_export s\_export\_articles s\_export\_attributes s\_export\_categories s\_export\_suppliers s\_filter s\_filter\_articles s\_filter\_attributes s\_filter\_options s\_filter\_relations s\_filter\_values s\_library\_component s\_library\_component\_field s\_media s\_media\_album s\_media\_album\_settings s\_media\_association s\_media\_attributes s\_multi\_edit\_backup s\_multi\_edit\_filter s\_multi\_edit\_queue s\_multi\_edit\_queue\_articles s\_order s\_order\_attributes s\_order\_basket s\_order\_basket\_attributes s\_order\_billingaddress s\_order\_billingaddress\_attributes s\_order\_comparisons s\_order\_details s\_order\_details\_attributes s\_order\_documents s\_order\_documents\_attributes s\_order\_esd s\_order\_history s\_order\_notes s\_order\_number s\_order\_shippingaddress s\_order\_shippingaddress\_attributes s\_plugin\_customizing\_articles s\_plugin\_customizing\_charge\_items s\_plugin\_customizing\_charge\_values s\_plugin\_customizing\_groups s\_plugin\_customizing\_options s\_plugin\_customizing\_types s\_plugin\_customizing\_values s\_plugin\_recommendations s\_plugin\_widgets\_notes s\_premium\_dispatch s\_premium\_dispatch\_attributes s\_premium\_dispatch\_categories s\_premium\_dispatch\_countries s\_premium\_dispatch\_holidays s\_premium\_dispatch\_paymentmeans s\_premium\_holidays s\_premium\_shippingcosts s\_product\_streams s\_product\_streams\_articles s\_product\_streams\_selection s\_schema\_version s\_search\_fields s\_search\_index s\_search\_keywords s\_search\_tables s\_statistics\_article\_impression s\_statistics\_currentusers s\_statistics\_pool s\_statistics\_referer s\_statistics\_search s\_statistics\_visitors s\_user s\_user\_attributes s\_user\_billingaddress s\_user\_billingaddress\_attributes s\_user\_debit s\_user\_shippingaddress s\_user\_shippingaddress\_attributes Wäre wirklich über jede Hilfe sehr dankbar. Gruß kweb

---

<div class="post-metadata">

**Author:** ![Thomas](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/thomas/32/8167_2.png) [@Thomas](https://forum.shopware.com/u/Thomas)\
**Post date:** [26. Januar 2016 um 08:19 UTC](https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816/7 "2016-01-26T08:19:05Z")

</div>

Kannst Du bitte mal folgende SQLs ausführen und die Rückgaben hier posten: ` DESCRIBE s\_article\_configurator\_template\_prices; DESCRIBE s\_article\_configurator\_template\_prices\_attributes; ` Gruß

---

<div class="post-metadata">

**Author:** ![kweb](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@kweb](https://forum.shopware.com/u/kweb)\
**Post date:** [26. Januar 2016 um 08:47 UTC](https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816/8 "2016-01-26T08:47:20Z")

</div>

> [@Thomas](#):
>
> Kannst Du bitte mal folgende SQLs ausführen und die Rückgaben hier posten: ` DESCRIBE s\_article\_configurator\_template\_prices; DESCRIBE s\_article\_configurator\_template\_prices\_attributes; ` Gruß[/quote] Hallo Thomas, hier die Rückgaben:+ [quote] Ihr SQL-Befehl wurde erfolgreich ausgeführt DESCRIBE s\_article\_configurator\_template\_prices;# Datensätze: 9 DESCRIBE s\_article\_configurator\_template\_prices\_attributes;# Datensätze: 2 [Bearbeiten] [PHP-Code erzeugen] Zeige Datensätze 0 - 1 ( 2 insgesamt, Die Abfrage dauerte 0.0004 Sekunden) DESCRIBE s\_article\_configurator\_template\_prices\_attributes

---

<div class="post-metadata">

**Author:** ![Thomas](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/thomas/32/8167_2.png) [@Thomas](https://forum.shopware.com/u/Thomas)\
**Post date:** [26. Januar 2016 um 08:57 UTC](https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816/9 "2016-01-26T08:57:10Z")

</div>

Die Abfragen musst Du einzeln ausführen sonst bekommst Du die Rückgabe nicht angezeigt. Bei mir sieht diese z.B. so aus: `+--------------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +--------------------+------------------+------+-----+---------+----------------+ | id | int(11) unsigned | NO | PRI | NULL | auto\_increment | | template\_id | int(10) unsigned | YES | MUL | NULL | | | customer\_group\_key | varchar(30) | NO | MUL | NULL | | | from | int(10) unsigned | NO | | NULL | | | to | varchar(30) | NO | | NULL | | | price | double | NO | | 0 | | | pseudoprice | double | YES | | NULL | | | baseprice | double | YES | | NULL | | | percent | decimal(10,2) | YES | | NULL | | +--------------------+------------------+------+-----+---------+----------------+ 9 rows in set (0,00 sec) `

---

<div class="post-metadata">

**Author:** ![kweb](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@kweb](https://forum.shopware.com/u/kweb)\
**Post date:** [26. Januar 2016 um 09:21 UTC](https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816/10 "2016-01-26T09:21:40Z")

</div>

Hi, sorry 😕 Hier für die prices: und hier für die prices\_attributes

---

<div class="post-metadata">

**Author:** ![Thomas](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/thomas/32/8167_2.png) [@Thomas](https://forum.shopware.com/u/Thomas)\
**Post date:** [26. Januar 2016 um 10:30 UTC](https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816/11 "2016-01-26T10:30:37Z")

</div>

Sehen diese Tabellen unterschiedlich aus zu denen aus den anderen Shops wo das script funktioniert?

---

<div class="post-metadata">

**Author:** ![kweb](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@kweb](https://forum.shopware.com/u/kweb)\
**Post date:** [26. Januar 2016 um 11:59 UTC](https://forum.shopware.com/t/repair-foreign-keys-lauft-nicht-durch-fehlermeldung/33816/12 "2016-01-26T11:59:41Z")

</div>

[quote=„Thomas“]Sehen diese Tabellen unterschiedlich aus zu denen aus den anderen Shops wo das script funktioniert?[/quote] Nein, alles identisch 😢 Oh man das kann doch nicht wahr sein 😕 Welche Möglichkeiten gibt es noch?!
