I need to make a copy of a row in a table and also copy all the rows that link to it via its foreign key in other tables. And then copy all the rows that link to these rows.
The problem is when I make a copy of the row the key is going to change. How can I propagate these changes through the relationships between tables?