# Datenbank Aktualisierung nach Update

**URL:** <https://forum.shopware.com/t/datenbank-aktualisierung-nach-update/101483>\
**Category:** Allgemein\
**Created:** [5. Oktober 2023 um 21:49 UTC](https://forum.shopware.com/t/datenbank-aktualisierung-nach-update/101483 "2023-10-05T21:49:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![cmichael](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/cmichael/32/17810_2.png) [@cmichael](https://forum.shopware.com/u/cmichael)\
**Post date:** [8. Oktober 2023 um 15:51 UTC](https://forum.shopware.com/t/datenbank-aktualisierung-nach-update/101483/2 "2023-10-08T15:51:18Z")

</div>

Ich habe es ausprobiert und einen Weg gefunden.

Nach Einspielen der Produktiven DB in die Entwicklungs-Copy konnte ich mich zunächst weiterhin ins Backend einloggen. Dort aber kein Hinweis auf eine veraltete Datenbankstruktur zu finden. Als Hinweis reichte aber: Die Bestelldaten waren komplett leer und das Frontend antwortete mit einem 500er Error.

Mit dem Consolen-Befehl:

```auto
bin/console database:migrate core --all

```

waren dann Bestelldaten und Frontend wieder da. Das scheint die Lösung zu sein.

Ich will noch erwähnen, dass der Consolen-Befehl mit einem SQL Error abgebrochen ist:

```auto
SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP FOREIGN KEY `fk.order_customer.salutation_id`; check that it exists

```

Über phpmyadmin hab ich dann vorab folgendes SQL ausgeführt, erst danach lief die Migration mit dem Consolen-Befehl sauber durch:

ALTER TABLE `order_customer` ADD CONSTRAINT `fk.order_customer.salutation_id` FOREIGN KEY (`salutation_id`) REFERENCES `salutation` (`id`) ON DELETE CASCADE ON UPDATE CASCADE

Und vorher noch, der mysqldump der Produktiven DB konnte nicht in die Entwicklungs-Copy eingespielt werden:

```auto
Function or expression 'variant_listing_config' cannot be used in the CHECK clause of variant_listing_config``

```

Ich habe dann im sql der Dump-Datei eine Stelle anpassen müssen wie hier beschrieben:  
Danke an:

> [@Fehlermeldung Datenbank einspielen aus Datensicherung](https://forum.shopware.com/t/fehlermeldung-datenbank-einspielen-aus-datensicherung/101082):
>
> Hallo zusammen, ich wollte gerade eine Datensicherung einspielen und bekomme folgende Fehlermeldung: Function or expression 'variant\_listing\_config' cannot be used in the CHECK clause of variant\_listing\_config`` Der Fehler tritt an der Stelle auf: `variant_listing_config` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4\_bin GENERATED ALWAYS AS (case when `display_parent` is not null or `main_variant_id` is not null or `configurator_group_config` is not null then json\_object('displayParent',`…

Freue mich wenn es jemandem weiterhilft und gerne auch auf Feedback 🙂

---

_[View the full topic](https://forum.shopware.com/t/datenbank-aktualisierung-nach-update/101483)._
