Cascading deletion in DB #99479
Labels
accredited-rep-facing
Accredited Representative Facing Team
arf-icebox
backend
engineering
Engineering topics
Milestone
Description
Even though I don't think most of the parent records described below should be getting deleted, if any did, there are child records that are nonsensical in the absence of their parent. We can add foreign key cascade delete for that and also a trigger in the polymorphic case. This is instead of using the
:dependent
option onActiveRecord
model associations or anything like that (can read about this in the Deleting from associations section of Rails API docs). Again, we're not going to delete the records and also buying into Rails's model-centrism for business logic and such needs a lot of motivation to actually opt in to in my opinion.This deletion cascade should be defined in the DB:
power_of_attorney_requests -> power_of_attorney_forms
power_of_attorney_requests -> power_of_attorney_request_resolutions
power_of_attorney_request_resolutions -> power_of_attorney_request_decisions
power_of_attorney_request_resolutions -> power_of_attorney_request_expirations
Acceptance Criteria
The text was updated successfully, but these errors were encountered: