RelationContract (hasMany) and FieldRelationContract (belongsTo) accept ClearOnChange, a list of nullable columns set to NULL whenever the relation changes the foreign key: a hasMany link and unlink (deferred ones included) clear them on the child, and a form save that moves a belongsTo key to another record or to none clears them on the record unless the same save writes the column through its own field. Boot refuses the option on a belongsToMany and for a missing, non-nullable, foreign-key or primary-key column. The zero value changes nothing.
9.4 KiB
9.4 KiB