-
Notifications
You must be signed in to change notification settings - Fork 53
Open
Description
Is there a way to clone a model with a relation, but on the related model also update another ID column to match the equivalent cloned model's ID?
e.g.
Say you have Section containing many Posts and Comments. A post has many comments. But a comment also belongsTo a different post in that section:
Table: comments
id | post_id | related_post_id
Clone a section & Posts, with comments (straight forward)
But then if I make the relatedPost relationship cloneable, yes it updates the related_post_id in the new comment row, but it also creates a new clone of that post too. How can I get it to just change the foreign_id without creating double posts?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels