Details
-
Type: Patch
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Fixed/Completed
-
Affects Version/s: 3.2
-
Fix Version/s: 3.2.2
-
Component/s: Core CiviCRM
-
Labels:None
Description
Adding this FK (and associated index) sped up the deletion of membership records, and it would seem other actions that require this join.
Attached is the patch for the XML schema and below is the SQL for the upgrade script:
ALTER TABLE civicrm_activity
ADD FOREIGN KEY FK_civicrm_activity_source_record_id
(source_record_id)
REFERENCES civicrm_contact (id)
ON DELETE SET NULL