# Dal:create:schema

**URL:** <https://forum.shopware.com/t/dalschema/88071>\
**Category:** Shopware 6 (German)\
**Created:** [2. Juni 2021 um 10:11 UTC](https://forum.shopware.com/t/dalschema/88071 "2021-06-02T10:11:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Liverson](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@Liverson](https://forum.shopware.com/u/Liverson)\
**Post date:** [2. Juni 2021 um 10:11 UTC](https://forum.shopware.com/t/dalschema/88071/1 "2021-06-02T10:11:05Z")

</div>

Hallo,

steh grad etwas auf dem Schlauch. Bei einem Plugin das ansonsten fehlerfrei läuft wird folgende Fehlermeldung ausgeworfen, wenn man über die Console (bin/console dal:create:schema) die Migration Files erzeugen will.

# DAL generate schema

In SchemaGenerator.php line 279:  
Call to a member function getStorageName() on null

Im Moment bin ich ratlos, wieso für die Table des Plugins das nicht funktioniert. Hat jemand einen Tipp für mich?

---

<div class="post-metadata">

**Author:** ![jniclas](https://avatars.discourse-cdn.com/v4/letter/j/779978/32.png) [@jniclas](https://forum.shopware.com/u/jniclas)\
**Post date:** [20. Juli 2021 um 10:41 UTC](https://forum.shopware.com/t/dalschema/88071/2 "2021-07-20T10:41:58Z")

</div>

Hey, hast du das Problem mitlerweile lösen können? Bei mir tritt das auch auf.

---

<div class="post-metadata">

**Author:** ![Liverson](https://avatars.discourse-cdn.com/v4/letter/l/b19c9b/32.png) [@Liverson](https://forum.shopware.com/u/Liverson)\
**Post date:** [20. Juli 2021 um 11:45 UTC](https://forum.shopware.com/t/dalschema/88071/3 "2021-07-20T11:45:09Z")

</div>

Soweit ich noch weiss, war das bei mir der Fall weil ich in meinem Plugin eine Association auf die Tabelle products hatte und in meiner Custom Entity keine Spalte mit der ‚product\_version\_id‘ angelegt. Wenn du eine Assiciation auf eine Tabelle machst, die eine version\_id besitzt, musst du die scheinbar auch mit einbauen.

---

<div class="post-metadata">

**Author:** ![alessandro](https://avatars.discourse-cdn.com/v4/letter/a/ac91a4/32.png) [@alessandro](https://forum.shopware.com/u/alessandro)\
**Post date:** [30. Januar 2022 um 19:28 UTC](https://forum.shopware.com/t/dalschema/88071/4 "2022-01-30T19:28:33Z")

</div>

das funktioniert bei mir

für die Relation Order.  
` (new ReferenceVersionField(OrderDefinition::class))->addFlags(new ApiAware(), new Required()),`

für die Relation Product.

` (new ReferenceVersionField(ProductDefinition::class))->addFlags(new ApiAware(), new Required()),`
