When updating a Statique entry, we manipulate multiple database tables. Some of those tables have no unicity criterion that allows us to update a PointDeCharge-related entry, but instead creates a new entry, leaving the former entry possibly orphan, i.e. not linked to any PointDeCharge.
Example: if we update the contact_amenageur field of a Statique entry, we will create a new entry for the Amenageur table and link this entry to the updated PointDeCharge. The original Amenageur entry won't be linked to this PointDeCharge, making it (possibly) orphan.
Proposal
Maybe we should be more granular and allow to update all statique-related entries (database tables) using a dedicated endpoint per object: PUT /statique/amenageur/{amenageur_id}.
An alternative - temporary - solution may be to clean orphan entries regularly to avoid database pollution.
Purpose
When updating a
Statique
entry, we manipulate multiple database tables. Some of those tables have no unicity criterion that allows us to update aPointDeCharge
-related entry, but instead creates a new entry, leaving the former entry possibly orphan, i.e. not linked to anyPointDeCharge
.Example: if we update the
contact_amenageur
field of aStatique
entry, we will create a new entry for theAmenageur
table and link this entry to the updatedPointDeCharge
. The originalAmenageur
entry won't be linked to thisPointDeCharge
, making it (possibly) orphan.Proposal
Maybe we should be more granular and allow to update all statique-related entries (database tables) using a dedicated endpoint per object:
PUT /statique/amenageur/{amenageur_id}
.An alternative - temporary - solution may be to clean orphan entries regularly to avoid database pollution.