Bug 24010: DB Changes

Amended-patch: adjusted to new atomic update format

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit a7eee10279)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Jonathan Druart 2019-11-22 12:33:41 +01:00 committed by Lucas Gass
parent 854f192db6
commit 07d00657e0
2 changed files with 32 additions and 2 deletions

View File

@ -0,0 +1,30 @@
use Modern::Perl;
return {
bug_number => "24010",
description => "Make subscription.staffdisplaycount and opacdisplaycount integer columns",
up => sub {
my ($args) = @_;
my ($dbh, $out) = @$args{qw(dbh out)};
$dbh->do(q{
UPDATE subscription
SET staffdisplaycount = NULL
WHERE staffdisplaycount = ""
});
$dbh->do(q{
ALTER TABLE subscription
MODIFY COLUMN staffdisplaycount INT(11) NULL DEFAULT NULL
});
$dbh->do(q{
UPDATE subscription
SET opacdisplaycount = NULL
WHERE opacdisplaycount = ""
});
$dbh->do(q{
ALTER TABLE subscription
MODIFY COLUMN opacdisplaycount INT(11) NULL DEFAULT NULL
});
},
};

View File

@ -4874,8 +4874,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',