-- +--------------------------------------------------------------------+
--- | CiviCRM version 3.2 |
+-- | CiviCRM version 4.7 |
-- +--------------------------------------------------------------------+
--- | Copyright CiviCRM LLC (c) 2004-2010 |
+-- | Copyright CiviCRM LLC (c) 2004-2015 |
-- +--------------------------------------------------------------------+
-- | This file is a part of CiviCRM. |
-- | |
-- we delete the corresponding entity_id/entity_table entries
-- from all the linked tables (note, log etc)
DELETE FROM civicrm_note
- WHERE entity_id = OLD.id
+ WHERE entity_id = OLD.id
AND entity_table = 'civicrm_contact';
DELETE FROM civicrm_log
WHERE entity_id = OLD.id
AND entity_table = 'civicrm_contact';
- DELETE FROM civicrm_task_status
+ DELETE FROM civicrm_task_status
WHERE responsible_entity_id = OLD.id
AND responsible_entity_table = 'civicrm_contact';