Bugzilla – Attachment 134985 Details for
Bug 24010
Number of issues to display to staff accepts non-integer values
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 24010: DB Changes
Bug-24010-DB-Changes.patch (text/plain), 2.95 KB, created by
Owen Leonard
on 2022-05-13 17:21:55 UTC
(
hide
)
Description:
Bug 24010: DB Changes
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2022-05-13 17:21:55 UTC
Size:
2.95 KB
patch
obsolete
>From d3a889fa34c84c104e08ace72111a38371ef731b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 22 Nov 2019 12:33:41 +0100 >Subject: [PATCH] Bug 24010: DB Changes > >--- > .../data/mysql/atomicupdate/bug_24010.perl | 29 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 4 +-- > 2 files changed, 31 insertions(+), 2 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_24010.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_24010.perl b/installer/data/mysql/atomicupdate/bug_24010.perl >new file mode 100644 >index 0000000000..9db6b350df >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_24010.perl >@@ -0,0 +1,29 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ >+ my $RaiseError = $dbh->{RaiseError}; >+ $dbh->{RaiseError} = 1; >+ eval { >+ $dbh->do(q| >+ ALTER TABLE subscription >+ MODIFY COLUMN staffdisplaycount INT(11) NULL DEFAULT NULL; >+ |); >+ }; >+ if ( $@ ) { >+ warn "You have values in subscription.staffdisplaycount that are not integer. You must modify them manual and execute manually the previous SQL query.\n"; >+ } >+ >+ eval { >+ $dbh->do(q| >+ ALTER TABLE subscription >+ MODIFY COLUMN opacdisplaycount INT(11) NULL DEFAULT NULL; >+ |); >+ }; >+ if ( $@ ) { >+ warn "You have values in subscription.opacdisplaycount that are not integer. You must modify them manual and execute manually the previous SQL query.\n"; >+ } >+ $dbh->{RaiseError} = $RaiseError; >+ >+ SetVersion( $DBversion ); >+ print "Upgrade to $DBversion done (Bug 24010 Make subscription.staffdisplaycount and opacdisplaycount integer columns)\n"; >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 852d448804..f305e9c8dc 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -4869,8 +4869,8 @@ CREATE TABLE `subscription` ( > `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'default branches (items.homebranch)', > `lastbranch` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, > `serialsadditems` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'does receiving this serial create an item record', >- `staffdisplaycount` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'how many issues to show to the staff', >- `opacdisplaycount` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'how many issues to show to the public', >+ `staffdisplaycount` INT(11) NULL DEFAULT NULL, -- how many issues to show to the staff >+ `opacdisplaycount` INT(11) NULL DEFAULT NULL, -- how many issues to show to the public > `graceperiod` int(11) NOT NULL DEFAULT 0 COMMENT 'grace period in days', > `enddate` date DEFAULT NULL COMMENT 'subscription end date', > `closed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'yes / no if the subscription is closed', >-- >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 24010
:
95610
|
95717
|
95718
|
95847
|
95935
|
134985
|
134986
|
135092
|
136538
|
136539
|
137060
|
137062
|
137175