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

(-)a/installer/data/mysql/atomicupdate/bug_24010.perl (+29 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    my $RaiseError = $dbh->{RaiseError};
5
    $dbh->{RaiseError} = 1;
6
    eval {
7
        $dbh->do(q|
8
            ALTER TABLE subscription
9
            MODIFY COLUMN staffdisplaycount INT(11) NULL DEFAULT NULL;
10
        |);
11
    };
12
    if ( $@ ) {
13
        warn "You have values in subscription.staffdisplaycount that are not integer. You must modify them manual and execute manually the previous SQL query.\n";
14
    }
15
16
    eval {
17
        $dbh->do(q|
18
            ALTER TABLE subscription
19
            MODIFY COLUMN opacdisplaycount INT(11) NULL DEFAULT NULL;
20
        |);
21
    };
22
    if ( $@ ) {
23
        warn "You have values in subscription.opacdisplaycount that are not integer. You must modify them manual and execute manually the previous SQL query.\n";
24
    }
25
    $dbh->{RaiseError} = $RaiseError;
26
27
    SetVersion( $DBversion );
28
    print "Upgrade to $DBversion done (Bug 24010 Make subscription.staffdisplaycount and opacdisplaycount integer columns)\n";
29
}
(-)a/installer/data/mysql/kohastructure.sql (-3 / +2 lines)
Lines 4869-4876 CREATE TABLE `subscription` ( Link Here
4869
  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'default branches (items.homebranch)',
4869
  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'default branches (items.homebranch)',
4870
  `lastbranch` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
4870
  `lastbranch` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
4871
  `serialsadditems` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'does receiving this serial create an item record',
4871
  `serialsadditems` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'does receiving this serial create an item record',
4872
  `staffdisplaycount` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'how many issues to show to the staff',
4872
  `staffdisplaycount` INT(11) NULL DEFAULT NULL, -- how many issues to show to the staff
4873
  `opacdisplaycount` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'how many issues to show to the public',
4873
  `opacdisplaycount` INT(11) NULL DEFAULT NULL, -- how many issues to show to the public
4874
  `graceperiod` int(11) NOT NULL DEFAULT 0 COMMENT 'grace period in days',
4874
  `graceperiod` int(11) NOT NULL DEFAULT 0 COMMENT 'grace period in days',
4875
  `enddate` date DEFAULT NULL COMMENT 'subscription end date',
4875
  `enddate` date DEFAULT NULL COMMENT 'subscription end date',
4876
  `closed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'yes / no if the subscription is closed',
4876
  `closed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'yes / no if the subscription is closed',
4877
- 

Return to bug 24010