Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-6565

FK missing on civicrm_activity.source_record_id

    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

        Attachments

        1. 3.2.1.mysql.tpl.patch
          0.9 kB
          xavier dutoit
        2. Activity.xml.patch
          0.6 kB
          Michael McAndrew
        3. Activity.xml.patch
          0.6 kB
          Michael McAndrew

          Activity

            People

            • Assignee:
              sunny.sharma Sunny Sharma
              Reporter:
              michaelmcandrew Michael McAndrew
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: