If you create a custom extension that has an entity myext/product and try and give it a relationship to catalog/product, the extension attempts to use the same id field for the relationship. Attempting to create the same column name twice in the migration just results in a single column, so myext_product_product consists of only rel_id, product_id and position, with product_id having a foreign key to both myext_product and catalog_product_entity.
Fixing the generated code requires manually modifying the migration script to update the second column name and FK and manually updating the blocks and models that interact with the relationship.
Presumably you'd hit similar issues with category.
Raising this purely so it's documented incase anyone else hits it, rather than in expectation of a fix. I'd imagine most people don't need a custom entity called Product and I'm assuming at this point, any free time you have will be focused on the M2 version.
If you create a custom extension that has an entity
myext/product
and try and give it a relationship tocatalog/product
, the extension attempts to use the same id field for the relationship. Attempting to create the same column name twice in the migration just results in a single column, somyext_product_product
consists of onlyrel_id
,product_id
andposition
, withproduct_id
having a foreign key to bothmyext_product
andcatalog_product_entity
.Fixing the generated code requires manually modifying the migration script to update the second column name and FK and manually updating the blocks and models that interact with the relationship.
Presumably you'd hit similar issues with
category
.Raising this purely so it's documented incase anyone else hits it, rather than in expectation of a fix. I'd imagine most people don't need a custom entity called Product and I'm assuming at this point, any free time you have will be focused on the M2 version.