Open grossvater opened 1 year ago
Of course an workaround might be to remove the autosave:"true" between Product and PropertyGroup, but this would break the insert when the PropertyGroup doesn't exist.
one possible fix that I can think of is to not do any updates/insert if the struct only have primary fields, but this will still break the insert if property group doesn't exists 🤔
with a reference to an existing PropertyGroup
seems the best way to go here is to disable autosave and set property group using PropertyGroupId
I have a mapping like this:
Please note that what's important here is the PropertyGroup, which has no data fields. I kept Property in sample only to show what I want to achieve and why I might need such an empty table.
When doing the insert for Product, with a reference to an existing PropertyGroup, I have this error:
pq: syntax error at or near "WHERE"
Generated sql is this:
UPDATE "property_groups" SET WHERE "property_groups"."id"=$1; - pq: syntax error at or near "WHERE"
Of course an workaround might be to remove the autosave:"true" between Product and PropertyGroup, but this would break the insert when the PropertyGroup doesn't exist.