Jump to content
Sign in to follow this  
jjjjp

Problem Importing when Automatic Deletion is set in Relationships Table

Recommended Posts

To allow for easy, simultaneous deletions of a parent and its children, I have started to take advantage of the following setting in the Relationship Table: "Delete related records in this table when a record is deleted in the other table." However, I import data from the user's version of my database into my developer's version by deleting all records from tables in my version and then adding records from the users' version while matching names. I noticed after an import that some tables were missing all their data and figured out that the cause was automatic deletion of records and unlucky order of imports. Because I had arranged the imports in alphabetical order, I was importing the parent (workshop) after its children (team members, offerings), and the children got wiped out because of the cascading effect of the initial deletion of workshops.

 

The ideal solution would be to suspend the cascading deletions set up in the Relationship Table while importing, but I gather that is impossible. What are best practices for avoiding deletion of records while importing? (1) Be ultra-methodical about how one orders imports? (Do the rules against circularity in the Relationship Table guarantee that there is always an order that will work, even with a lot of these automatic deletions set up?) (2) Stop relying on automatic deletions and instead delete children using a loop in a transaction with the parent as the record and the children in a portal? (Inelegant and inefficient.) (3) Use some third way that I don't know about?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.