This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
lockzackary7643
I have a model DeskListing
with a relation:
public $hasOne = [ 'deskTypeId' => ['\DeskType', 'key' => 'id']];
On its columns.yaml, it works as expected:
deskTypeId:
label: Desk Type
relation: deskTypeId
select: name
But when trying to save / update it on the backend's controller, it produces integrity constraint violations because:
update `desk_types` set `id` = 0 where `id` = 10
it tries to update the related DeskType's id
instead of DeskListing's deskTypeId
can you tell me what's wrong with my models?
Last updated
1-1 of 1