[ 
https://issues.apache.org/jira/browse/OFBIZ-1313?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12532561
 ] 

Jonathon Wong commented on OFBIZ-1313:
--------------------------------------

The way I usually do it is to:

1. Null the field pointing to the record I am about the delete.

2. Delete the record.

Isn't there a "cascade set null on delete" in the Entity Engine (and for all 
RDBMSes)? If not, I'd recommend just doing the above manual steps.

It's not good to keep a non-null field pointing to a non-existent record. Very 
misleading.

> Remove some Visit-related foreign keys
> --------------------------------------
>
>                 Key: OFBIZ-1313
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1313
>             Project: OFBiz
>          Issue Type: Improvement
>            Reporter: Si Chen
>            Assignee: Si Chen
>            Priority: Minor
>
> I would recommend that we remove the foreign keys to the Visit entity, so old 
> Visit records can be safely deleted without affecting data in 
> TrackingCodeVisit, which might be useful for statistical and reporting 
> purposes.  It should not affect the core entities.  The visits would only no 
> longer be available after some time has passed.
> If no one has any objections I'll take care of this.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to