You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
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?
The text was updated successfully, but these errors were encountered: