Bugzilla – Attachment 163966 Details for
Bug 35610
Missing FK on old_reserves.branchcode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35610: Add FK on old_reserves.branchcode
Bug-35610-Add-FK-on-oldreservesbranchcode.patch (text/plain), 2.70 KB, created by
Victor Grousset/tuxayo
on 2024-03-27 01:36:58 UTC
(
hide
)
Description:
Bug 35610: Add FK on old_reserves.branchcode
Filename:
MIME Type:
Creator:
Victor Grousset/tuxayo
Created:
2024-03-27 01:36:58 UTC
Size:
2.70 KB
patch
obsolete
>From d07f1af0e8ca746ac58dcc2f477553ecd9b71159 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 20 Dec 2023 10:35:17 +0100 >Subject: [PATCH] Bug 35610: Add FK on old_reserves.branchcode > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >--- > installer/data/mysql/atomicupdate/bug_35610.pl | 18 ++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 3 ++- > 2 files changed, 20 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_35610.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_35610.pl b/installer/data/mysql/atomicupdate/bug_35610.pl >new file mode 100755 >index 0000000000..e9e2c10725 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_35610.pl >@@ -0,0 +1,18 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "35610", >+ description => "Add FK on old_reserves.branchcode", >+ up => sub { >+ my ($args) = @_; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; >+ >+ unless ( foreign_key_exists('old_reserves', 'old_reserves_ibfk_branchcode') ) { >+ $dbh->do(q{ >+ ALTER TABLE old_reserves >+ ADD CONSTRAINT `old_reserves_ibfk_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE; >+ }); >+ say $out "Added foreign key on 'old_reserves.branchcode'" >+ } >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index ea540c0819..3828776962 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4916,7 +4916,8 @@ CREATE TABLE `old_reserves` ( > CONSTRAINT `old_reserves_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE SET NULL, > CONSTRAINT `old_reserves_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL, > CONSTRAINT `old_reserves_ibfk_4` FOREIGN KEY (`itemtype`) REFERENCES `itemtypes` (`itemtype`) ON DELETE SET NULL ON UPDATE SET NULL, >- CONSTRAINT `old_reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE SET NULL ON UPDATE SET NULL >+ CONSTRAINT `old_reserves_ibfk_ig` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE SET NULL ON UPDATE SET NULL, >+ CONSTRAINT `old_reserves_ibfk_branchcode` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > /*!40101 SET character_set_client = @saved_cs_client */; > >-- >2.44.0
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 35610
:
160097
|
160098
|
161540
|
163827
| 163966 |
163967
|
163968