Bug 42046 - Bug 30331 database update is not idempotent
Summary: Bug 30331 database update is not idempotent
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Lucas Gass (lukeg)
QA Contact: Testopia
URL:
Keywords:
Depends on: 30331
Blocks:
  Show dependency treegraph
 
Reported: 2026-03-09 21:05 UTC by Lucas Gass (lukeg)
Modified: 2026-03-09 21:09 UTC (History)
0 users

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 42046: Make DR Rev 25.12.00.18 more resilient (1.47 KB, patch)
2026-03-09 21:09 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Lucas Gass (lukeg) 2026-03-09 21:05:36 UTC
The DBRev for Bug 30331 is not idempotent:

my $base_period = C4::Context->preference('RenewalPeriodBase');

$dbh->do(
    q{
        UPDATE systempreferences SET variable = 'ManualRenewalPeriodBase' WHERE variable = 'RenewalPeriodBase'
    }
);


When ran twice:

"ERROR: {UNKNOWN}: DBI Exception: DBD:
:db do failed: Duplicate entry 'ManualRenewalPeriodBase' for key 'PRIMARY' at /kohadevbox/koha/C4/Installer.pm line 819"
Comment 1 Lucas Gass (lukeg) 2026-03-09 21:09:20 UTC
Created attachment 195031 [details] [review]
Bug 42046: Make DR Rev 25.12.00.18 more resilient