Uploaded image for project: 'COmanage'
  1. COmanage
  2. CO-404

Delete CO Person Referenced From History Violates Foreign Key Constraint

    XMLWordPrintable

Details

    Description

      Both co_petition_history_records and history_records have foreign key constraints for actor_co_person_id. If the referenced CO Person is deleted (which ordinarily isn't recommended), a foreign key constraint violation will occur.

      (Note: prior to 0.7, CoPetitionHistoryRecord was flagged as 'dependent' to CoPerson, and so the record itself would have been deleted. That seems like the wrong behavior.)

      One option would be to update actor_co_person_id to NULL prior to deleting the CO Person. Another would be to simply not permit the delete as it would violate data integrity. A third would be to create an archived CO Person to reference. (This is sort of a variation on option #2.)

      Attachments

        Issue Links

          Activity

            People

              benn.oshrin@at.internet2.edu Benn Oshrin (internet2.edu)
              benn.oshrin@at.internet2.edu Benn Oshrin (internet2.edu)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: