[FOLIO-2446] Deletion of referenced records Created: 05/Feb/20  Updated: 07/Mar/22

Status: Open
Project: FOLIO
Components: None
Affects versions: None
Fix versions: None

Type: Story Priority: P3
Reporter: Craig McNally Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original estimate: Not Specified

Issue links:
Defines
defines UXPROD-1889 Inventory. Settings: Delete warning w... Open
Relates
relates to UITEN-128 Permissions Architecture: Courses err... Closed
Sprint:

 Description   

Overview

How do we maintain reference integrity when deleting records that are referenced elsewhere? While technically this problem exists both within the context of a single module and across more than one module, the latter case is more challenging and the focus of this story.

Concrete Examples

  • Orders (piece) references an inventory (item) record. If the item is removed, the reference in the piece will point to a record that no longer exists.
  • Various records in orders, organizations, invoice, finance reference acquisitions-unit records. If an acquisition-unit is removed, this could be problematic for those records that are associated with it.
  • Circulation (loan) references an inventory (item) record. If the item is removed, the reference in the loan will point to a record that no longer exists.

Approaches

The tech leads group discussed this topic briefly. Here are some of the solutions discussed:

  • soft delete - don't delete the record, but mark it as "deleted" and adjust queries and/or business logic so that these records are hidden.
  • prevent deletion of referenced record - before deleting a record, search for records that reference it, and if any are found, prevent the record from being deleted
  • cascading delete - may make sense in some cases if everything is within a single module, but how do you know for sure that it isn't referenced elsewhere?
  • pub-sub: notification - publish an event whenever a record is deleted, allowing other modules to clean up references, or perform other appropriate actions.
  • pub-sub: ask for permission to delete - I want to delete a record, ask other modules if it's ok to proceed


 Comments   
Comment by Charlotte Whitt [ 11/May/21 ]

Hi Craig McNally and Marc Johnson - I linked up this ticket with UXPROD-1889 Open .

This work was discussed with the Tech Leads last year. Has this come up in later discussions/talks since February 2020, and have there been made any decision on which approach to follow?

Comment by Marc Johnson [ 11/May/21 ]

Charlotte Whitt

This work was discussed with the Tech Leads last year. Has this come up in later discussions/talks since February 2020, and have there been made any decision on which approach to follow?

Yes, this has come up a few times since then, most recently on 2020-03-24. Zak Burke has raised a draft decision log entry for it for further discussion.

I believe the App Interaction SIG has also been having discussions about this.

I don't believe any decision has been made about how to do this. I believe some areas have already followed one of those paths (and in some cases this has caused challenges).

Personally, I don't think this a wholly technical decision. Each of those options provide a different user experience, which I think means that we need involvement from the domain folks to make these decisions. It might be that different approaches are taken in different areas.

Comment by Charlotte Whitt [ 07/Mar/22 ]

Marc Johnson - with the latest work on MODINSTOR-829 - does that pave the path for this ticket FOLIO-2446 Open to be worked on as well - as a central solution?

Or do we still need to write up a ticket for every Settings page with reference values? See some of the tickets already filed and listed as defining the feature UXPROD-1889 Open (release Morning Glory or Nolana) . Please advise.

Comment by Marc Johnson [ 07/Mar/22 ]

Charlotte Whitt

with the latest work on MODINSTOR-829 - does that pave the path for this ticket FOLIO-2446 Open to be worked on as well - as a central solution?

That really depends upon the scope of this issue.

MODINVSTOR-829 Closed provides a specific solution to when an array field (for when something can be related to more than 1, e.g. an instance can have more than one statistical code) is used to reference a record.

It is not a general solution to protection from deletion when a record is referenced anywhere or in any way.

Or do we still need to write up a ticket for every Settings page with reference values?

Even if we came up with a generally applicable solution, there would still need to be work for every set of records that can be referenced and likely for every referrer.

Generated at Thu Feb 08 23:20:41 UTC 2024 using Jira 1001.0.0-SNAPSHOT#100246-sha1:7a5c50119eb0633d306e14180817ddef5e80c75d.