Answers.Body: <p>Run below query</p>
  <pre><code>ALTER TABLE civicrm_activity_contact DROP FOREIGN KEY FK_civicrm_activity_contact_activity_id;
  
  ALTER TABLE civicrm_activity_contact 
  ADD CONSTRAINT `FK_civicrm_activity_contact_activity_id` FOREIGN KEY (`activity_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE CASCADE;
  </code></pre>
  <p>Note: Take db backup before running query</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-28T13:56:19.633Z
Answers.Text: Pradeep , you are a saviour sir. That has sorted my issue , thank you very much indeed for this
Answers.UserDisplayName: Paul Butler
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-28T11:33:37.383Z
Answers.LastActivityDate: 2023-11-28T13:59:14.183Z
Answers.LastEditDate: 2023-11-28T13:59:14.183Z
Answers.UserDisplayName: Pradeep Nayak
Answers.Body: <p>This <em><strong>civicrm_activity_fudge</strong></em> foreign key reference doesn't seem to be a part of the default  <em>civicrm_activity_contact</em> table structure, you may want to check why it is there and, depending on your circumstances, fix it or remove it from the table. Please do not forget to <strong>backup the whole database</strong> before making changes.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-11-28T10:54:14.443Z
Answers.LastActivityDate: 2023-12-01T16:05:12.013Z
Answers.LastEditDate: 2023-12-01T16:05:12.013Z
Answers.UserDisplayName: yurg
Body: <p>When initiating the Send Reminder job I am getting this error:</p>
  <p><a href="https://i.sstatic.net/C04LK.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/C04LK.jpg" alt="enter image description here" /></a></p>
  <p>I have similar issues showing up in System Status</p>
  <p><a href="https://i.sstatic.net/tDkkM.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tDkkM.jpg" alt="enter image description here" /></a></p>
  <p>How can I find out what is causing the violation?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-11-28T10:40:18.997Z
Comments.Text: via cv got this
  
  "error_code": -3,
      "debug_info": "INSERT INTO `civicrm_activity_contact` (`activity_id` , `contact_id` , `record_type_id` ) VALUES ( 202280 ,  2067 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`hetclub_prod`.`civicrm_activity_contact`, CONSTRAINT `FK_civicrm_activity_contact_activity_id` FOREIGN KEY (`activity_id`) REFERENCES `civicrm_activity_fudge` (`id`) ON DELETE CASCADE)]",
      "entity": "Job",
      "action": "send_reminder",
      "is_error": 1,
      "error_message": "DB Error: constraint violation"
  }
Comments.UserDisplayName: Paul Butler
Tags: <scheduled-reminders>
Title: Send Reminder filing
ThreadText: # Send Reminder filing
  
  (Asked by: username_0 on 2023-11-28)
  
  When initiating the Send Reminder job I am getting this error:
  
  [![enter image description here](https://i.sstatic.net/C04LK.jpg)](https://i.sstatic.net/C04LK.jpg)
  
  I have similar issues showing up in System Status
  
  [![enter image description here](https://i.sstatic.net/tDkkM.jpg)](https://i.sstatic.net/tDkkM.jpg)
  
  How can I find out what is causing the violation?
  
  **Tags:** scheduled-reminders
  
  > **Comments:**
  > **username_0**: via cv got this  "error_code": -3,     "debug_info": "INSERT INTO `civicrm_activity_contact` (`activity_id` , `contact_id` , `record_type_id` ) VALUES ( 202280 ,  2067 ,  2 )  [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`hetclub_prod`.`civicrm_activity_contact`, CONSTRAINT `FK_civicrm_activity_contact_activity_id` FOREIGN KEY (`activity_id`) REFERENCES `civicrm_activity_fudge` (`id`) ON DELETE CASCADE)]",     "entity": "Job",     "action": "send_reminder",     "is_error": 1,     "error_message": "DB Error: constraint violation" }  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2023-11-28. Score: 0 | Accepted answer
  
  Run below query
  ALTER TABLE civicrm_activity_contact DROP FOREIGN KEY FK_civicrm_activity_contact_activity_id;
  
  ALTER TABLE civicrm_activity_contact 
  ADD CONSTRAINT `FK_civicrm_activity_contact_activity_id` FOREIGN KEY (`activity_id`) REFERENCES `civicrm_activity` (`id`) ON DELETE CASCADE;
  
  Note: Take db backup before running query
  
  > **Comments:**
  > **username_0**: Pradeep , you are a saviour sir. That has sorted my issue , thank you very much indeed for this  
  
  ---
  
  ### Answer by username_2 on 2023-11-28. Score: 2
  
  This ***civicrm\_activity\_fudge*** foreign key reference doesn't seem to be a part of the default *civicrm\_activity\_contact* table structure, you may want to check why it is there and, depending on your circumstances, fix it or remove it from the table. Please do not forget to **backup the whole database** before making changes.
  
  
  ---
  
  