Bugzilla – Attachment 187311 Details for
Bug 26993
Allow StoreLastBorrower to retain a locally-defined number of previous borrowers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26993: Database updates
Bug-26993-Database-updates.patch (text/plain), 2.45 KB, created by
Andrew Fuerste-Henry
on 2025-10-02 18:39:31 UTC
(
hide
)
Description:
Bug 26993: Database updates
Filename:
MIME Type:
Creator:
Andrew Fuerste-Henry
Created:
2025-10-02 18:39:31 UTC
Size:
2.45 KB
patch
obsolete
>From 6dae2562b2ad0bb881dd196ea8ee05221b646c6b Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Mon, 22 Sep 2025 21:39:58 +0000 >Subject: [PATCH] Bug 26993: Database updates > >Signed-off-by: Trevor Diamond <trevor.diamond@mainlib.org> >--- > .../data/mysql/atomicupdate/bug_26993.pl | 53 +++++++++++++++++++ > 1 file changed, 53 insertions(+) > create mode 100755 installer/data/mysql/atomicupdate/bug_26993.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_26993.pl b/installer/data/mysql/atomicupdate/bug_26993.pl >new file mode 100755 >index 00000000000..4e062eb9657 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_26993.pl >@@ -0,0 +1,53 @@ >+use Modern::Perl; >+use Koha::Installer::Output qw(say_warning say_success say_info); >+ >+return { >+ bug_number => "26993", >+ description => "Remove unique constraint on itemnumber in items_last_borrower to allow multiple borrowers per item", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ # Drop the foreign key constraint temporarily >+ if ( index_exists( 'items_last_borrower', 'itemnumber' ) ) { >+ $dbh->do( >+ q{ >+ ALTER TABLE items_last_borrower >+ DROP FOREIGN KEY items_last_borrower_ibfk_1 >+ } >+ ); >+ >+ # Drop the unique index >+ $dbh->do( >+ q{ >+ ALTER TABLE items_last_borrower DROP INDEX itemnumber >+ } >+ ); >+ >+ # Put the FK constraint back, without itemnumber having to be unique >+ $dbh->do( >+ q{ >+ ALTER TABLE items_last_borrower >+ ADD CONSTRAINT items_last_borrower_ibfk_1 >+ FOREIGN KEY (itemnumber) REFERENCES items (itemnumber) >+ ON DELETE CASCADE ON UPDATE CASCADE >+ } >+ ); >+ >+ say_success( $out, "Adjusted foreign key constraints on items_last_borrower table" ); >+ } >+ >+ # Update system preference from YesNo to Integer >+ $dbh->do( >+ q{ >+ UPDATE systempreferences >+ SET type = 'integer', >+ explanation = 'Defines the number of borrowers stored per item in the items_last_borrower table' >+ WHERE variable = 'StoreLastBorrower' >+ } >+ ); >+ >+ say_success( $out, "Updated StoreLastBorrower system preference to accept numeric values" ); >+ >+ }, >+}; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26993
:
186773
|
186774
|
186775
|
186776
|
186801
|
186805
|
186806
|
186807
|
186808
|
186809
|
186844
|
186853
| 187311 |
187312
|
187313
|
187314
|
187315
|
187316
|
187459
|
187460
|
187483
|
187484