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 2022-2029 CREATE TABLE `subscription` ( -- information related to the subscription Link Here
2022
  `branchcode` varchar(10) NOT NULL default '', -- default branches (items.homebranch)
2022
  `branchcode` varchar(10) NOT NULL default '', -- default branches (items.homebranch)
2023
  `lastbranch` varchar(10),
2023
  `lastbranch` varchar(10),
2024
  `serialsadditems` tinyint(1) NOT NULL default '0', -- does receiving this serial create an item record
2024
  `serialsadditems` tinyint(1) NOT NULL default '0', -- does receiving this serial create an item record
2025
  `staffdisplaycount` VARCHAR(10) NULL, -- how many issues to show to the staff
2025
  `staffdisplaycount` INT(11) NULL DEFAULT NULL, -- how many issues to show to the staff
2026
  `opacdisplaycount` VARCHAR(10) NULL, -- how many issues to show to the public
2026
  `opacdisplaycount` INT(11) NULL DEFAULT NULL, -- how many issues to show to the public
2027
  `graceperiod` int(11) NOT NULL default '0', -- grace period in days
2027
  `graceperiod` int(11) NOT NULL default '0', -- grace period in days
2028
  `enddate` date default NULL, -- subscription end date
2028
  `enddate` date default NULL, -- subscription end date
2029
  `closed` INT(1) NOT NULL DEFAULT 0, -- yes / no if the subscription is closed
2029
  `closed` INT(1) NOT NULL DEFAULT 0, -- yes / no if the subscription is closed
2030
- 

Return to bug 24010