Details
Description
Currently the FOREIGN KEY onDelete attributes for Mailing scheduled_id and created_id are set to CASCADE. This means that Mailings are lost if the creator or schedule are deleted - which is not desirable. Also, if the creator or scheduler are merged with another contact, their mailings are lost.
1. Fix onDelete attributes for both columns in schema - s/b SET NULL
2. Include ALTER TABLE for these changes in upgrade SQL
3. Investigate and fix Merge Contacts logic. If the contact record being merged is referenced in mailing.scheduled_id or created_id - the foreign key s/b updated to the merged-to contact's ID.