Bugzilla – Attachment 137635 Details for
Bug 31086
Do not allow hold requests with no branchcode
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 31086: DB update
Bug-31086-DB-update.patch (text/plain), 2.85 KB, created by
Martin Renvoize
on 2022-07-12 15:24:42 UTC
(
hide
)
Description:
Bug 31086: DB update
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2022-07-12 15:24:42 UTC
Size:
2.85 KB
patch
obsolete
>From daa231b461fc671bf83d81b3944e0bcadad621f2 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 1 Jul 2022 14:43:09 +0000 >Subject: [PATCH] Bug 31086: DB update > >This update sets branchcode as NOT NULL >default set to 0 as borrowernumber is > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > ...6_do_not_allow_null_branchcode_in_reserves.pl | 16 ++++++++++++++++ > installer/data/mysql/kohastructure.sql | 2 +- > 2 files changed, 17 insertions(+), 1 deletion(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_31086_do_not_allow_null_branchcode_in_reserves.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_31086_do_not_allow_null_branchcode_in_reserves.pl b/installer/data/mysql/atomicupdate/bug_31086_do_not_allow_null_branchcode_in_reserves.pl >new file mode 100755 >index 0000000000..f0635e1f2c >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_31086_do_not_allow_null_branchcode_in_reserves.pl >@@ -0,0 +1,16 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "31086", >+ description => "Do not allow null values in branchcodes for reserves", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ $dbh->do(q{ >+ ALTER TABLE reserves >+ MODIFY COLUMN `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 0 COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at' >+ }); >+ # Print useful stuff here >+ say $out "Removed NULL option from branchcode for reserves"; >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 54676b54e7..d3a9492923 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4439,7 +4439,7 @@ CREATE TABLE `reserves` ( > `borrowernumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the borrowers table defining which patron this hold is for', > `reservedate` date DEFAULT NULL COMMENT 'the date the hold was placed', > `biblionumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the biblio table defining which bib record this hold is on', >- `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at', >+ `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 0 COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at', > `desk_id` int(11) DEFAULT NULL COMMENT 'foreign key from the desks table defining which desk the patron should pick this hold up at', > `notificationdate` date DEFAULT NULL COMMENT 'currently unused', > `reminderdate` date DEFAULT NULL COMMENT 'currently unused', >-- >2.20.1
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 31086
:
136983
|
136984
|
136986
|
136987
|
137026
|
137254
|
137255
|
137256
|
137257
|
137258
| 137635 |
137636
|
137637
|
137638
|
137639
|
137640
|
137641
|
137642
|
138006
|
138018
|
138051
|
144824