View | Details | Raw Unified | Return to bug 24010
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/bug_24010.pl (+30 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "24010",
5
    description => "Make subscription.staffdisplaycount and opacdisplaycount integer columns",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{
11
            UPDATE subscription
12
            SET staffdisplaycount = NULL
13
            WHERE staffdisplaycount = ""
14
        });
15
        $dbh->do(q{
16
            ALTER TABLE subscription
17
            MODIFY COLUMN staffdisplaycount INT(11) NULL DEFAULT NULL
18
        });
19
20
        $dbh->do(q{
21
            UPDATE subscription
22
            SET opacdisplaycount = NULL
23
            WHERE opacdisplaycount = ""
24
        });
25
        $dbh->do(q{
26
            ALTER TABLE subscription
27
            MODIFY COLUMN opacdisplaycount INT(11) NULL DEFAULT NULL
28
        });
29
    },
30
};
(-)a/installer/data/mysql/kohastructure.sql (-3 / +2 lines)
Lines 4878-4885 CREATE TABLE `subscription` ( Link Here
4878
  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'default branches (items.homebranch)',
4878
  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'default branches (items.homebranch)',
4879
  `lastbranch` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
4879
  `lastbranch` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
4880
  `serialsadditems` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'does receiving this serial create an item record',
4880
  `serialsadditems` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'does receiving this serial create an item record',
4881
  `staffdisplaycount` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'how many issues to show to the staff',
4881
  `staffdisplaycount` INT(11) NULL DEFAULT NULL, -- how many issues to show to the staff
4882
  `opacdisplaycount` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'how many issues to show to the public',
4882
  `opacdisplaycount` INT(11) NULL DEFAULT NULL, -- how many issues to show to the public
4883
  `graceperiod` int(11) NOT NULL DEFAULT 0 COMMENT 'grace period in days',
4883
  `graceperiod` int(11) NOT NULL DEFAULT 0 COMMENT 'grace period in days',
4884
  `enddate` date DEFAULT NULL COMMENT 'subscription end date',
4884
  `enddate` date DEFAULT NULL COMMENT 'subscription end date',
4885
  `closed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'yes / no if the subscription is closed',
4885
  `closed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'yes / no if the subscription is closed',
4886
- 

Return to bug 24010