Details
-
Bug
-
Resolution: Invalid
-
Minor
-
COmanage Registry 0.6 (Helpful Hexagon)
-
None
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.)