[Koha-bugs] [Bug 18050] Missing constraint on aqbudgets.budget_period_id in aqbudgets

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Oct 9 21:14:29 CEST 2020


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18050

--- Comment #18 from Katrin Fischer <katrin.fischer at bsz-bw.de> ---
(In reply to Agustín Moyano from comment #15)
> Great job Katrin.. if I may add a comment, in the atomic update, if there
> are some budget periods that were not found, instead of not adding the FK
> constraint, I would:
> 
> 1. Create a temporary table.. something like _bug_18050_aqbudgets where I
> would copy the offending rows
> 
> 2. Update aqbudgets.budget_period_id to null, add the FK constraint
> 
> 3. Emit the warning that some budget periods where not found, and a copy of
> those rows where preserved in _bug_18050_aqbudgets table
> 
> If it's ok to you, I can add a follow-up with those steps

Hi Augustin, 

it's not as simple as that I am afraid. If there are orphan aqbudgets, there
could also be orders attached to them. And if there are orders, there could be
linked items... the rabbit hole is deeper.

Maybe another better approach could be to go the other direction: We add a
aqbudgetperiods entry - this would also allow the library to deal with things
in the GUI.

I am not sure I am able to write that one, so if anyone beats me to it I'd be
more than happy.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list