Bug 41421 - Bug 35830 DB update must be idempotent
Summary: Bug 35830 DB update must be idempotent
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Database (show other bugs)
Version: Main
Hardware: All All
: P5 - low critical
Assignee: Lucas Gass (lukeg)
QA Contact: Paul Derscheid
URL:
Keywords:
Depends on: 35830
Blocks:
  Show dependency treegraph
 
Reported: 2025-12-10 13:56 UTC by Lucas Gass (lukeg)
Modified: 2025-12-26 08:12 UTC (History)
3 users (show)

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


Attachments
Bug 41421: [25.11.x] Fix DB update (1.16 KB, patch)
2025-12-10 14:01 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 41421: [25.05.x] Fix DB update (1.16 KB, patch)
2025-12-10 14:03 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 41421: [24.11.x] Fix DB update (1.16 KB, patch)
2025-12-10 14:04 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 41421: [24.05.x] Fix DB update (1.16 KB, patch)
2025-12-10 14:06 UTC, Lucas Gass (lukeg)
Details | Diff | Splinter Review
Bug 41421: [22.11.x] Fix DB update (1.16 KB, patch)
2025-12-10 14:07 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) 2025-12-10 13:56:21 UTC
To recreate:

-Checkout 25.05.x 
-Add the edit_borrower permission to at least 1 borrower 
-sudo koha-mysql kohadev
-UPDATE systempreferences SET value='25.0505003' WHERE variable='Version';
-updatedatabase, you should see:

Upgrade to 25.05.05.004  [13:53:15]: Bug 35830 - Add permission borrowers:merge_borrowers
	Added new permission 'merge_borrowers'
	Added 'merge_borrowers' permission to existing users with 'edit_borrowers'


-major version upgrade with git checkout 25.11.x
-updatedatabase
it dies:

Upgrade to 25.06.00.028  [13:53:59]: Bug 35830 - Add permission borrowers:merge_borrowers
	Added new permission 'merge_borrowers'
	ERROR: {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Duplicate entry '19-4-merge_borrowers' for key 'PRIMARY' at /kohadevbox/koha/C4/Installer.pm line 82
Comment 1 Lucas Gass (lukeg) 2025-12-10 14:01:11 UTC
Created attachment 190391 [details] [review]
Bug 41421: [25.11.x] Fix DB update
Comment 2 Lucas Gass (lukeg) 2025-12-10 14:03:02 UTC
Created attachment 190392 [details] [review]
Bug 41421: [25.05.x] Fix DB update
Comment 3 Lucas Gass (lukeg) 2025-12-10 14:04:35 UTC
Created attachment 190393 [details] [review]
Bug 41421: [24.11.x] Fix DB update
Comment 4 Lucas Gass (lukeg) 2025-12-10 14:06:02 UTC
Created attachment 190394 [details] [review]
Bug 41421: [24.05.x] Fix DB update
Comment 5 Lucas Gass (lukeg) 2025-12-10 14:07:05 UTC
Created attachment 190395 [details] [review]
Bug 41421: [22.11.x] Fix DB update
Comment 6 Lucas Gass (lukeg) 2025-12-10 18:08:32 UTC
Pushed to main, thanks all!