`Shopware\Core\Framework\Migration\InheritanceUpdaterTrait` and `KEY`/`CONSTRAINT`

Looking at the InheritanceUpdaterTrait (platform/InheritanceUpdaterTrait.php at 42c8e52ea24366f3f19da913356b3356fc9dac0a · shopware/platform · GitHub) I can see that it only creates a BINARY(16) column and no KEY or CONSTRAINT.

  • When I generate the schema with ./bin/console ... I get KEY and CONSTRAINT SQL.
  • When I look at core entity tables in the DB (e.g. customer_address.country) I can see that there are keys and constraints defined.

What should I do?

  • Use explicit SQL in my migration to create KEYs and CONSTRAINTs instead of using $this-\>updateInheritance(...)?
  • Use $this-\>updateInheritance(...) and just live without KEYs and CONSTRAINTs?
  • Do further investigation because I misunderstood how to associate my own entity to a core entity?

… also: the last argument of updateInheritance seems to be the storage name (e.g. ‚my_custom_entity_id‘) and not the the property name (e.g. ‚myCustomEntity‘ or ‚myCustomEntityId‘ as suggested by the argument name ‚$propertyName‘).