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

(-)a/installer/data/mysql/atomicupdate/bug_23727.perl (+20 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    if ( !column_exists( 'course_items', 'itype_enabled' ) ) {
4
        $dbh->do(q{
5
            ALTER TABLE course_items ADD COLUMN itype_enabled tinyint(1) NOT NULL DEFAULT 0 AFTER itype;
6
        });
7
        $dbh->do(q{
8
            ALTER TABLE course_items ADD COLUMN ccode_enabled tinyint(1) NOT NULL DEFAULT 0 AFTER ccode;
9
        });
10
        $dbh->do(q{
11
            ALTER TABLE course_items ADD COLUMN holdingbranch_enabled tinyint(1) NOT NULL DEFAULT 0 AFTER holdingbranch;
12
        });
13
        $dbh->do(q{
14
            ALTER TABLE course_items ADD COLUMN location_enabled tinyint(1) NOT NULL DEFAULT 0 AFTER location;
15
        });
16
    }
17
18
    SetVersion( $DBversion );
19
    print "Upgrade to $DBversion done (Bug 23727 - Editing course reserve items is broken)\n";
20
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +4 lines)
Lines 3790-3798 CREATE TABLE `course_items` ( Link Here
3790
  `ci_id` int(11) NOT NULL AUTO_INCREMENT, -- course item id
3790
  `ci_id` int(11) NOT NULL AUTO_INCREMENT, -- course item id
3791
  `itemnumber` int(11) NOT NULL, -- items.itemnumber for the item on reserve
3791
  `itemnumber` int(11) NOT NULL, -- items.itemnumber for the item on reserve
3792
  `itype` varchar(10) DEFAULT NULL, -- new itemtype for the item to have while on reserve (optional)
3792
  `itype` varchar(10) DEFAULT NULL, -- new itemtype for the item to have while on reserve (optional)
3793
  `itype_enabled` tinyint(1) NOT NULL DEFAULT 0, -- indicates if itype should be changed while on course reserve
3793
  `ccode` varchar(80) DEFAULT NULL, -- new category code for the item to have while on reserve (optional)
3794
  `ccode` varchar(80) DEFAULT NULL, -- new category code for the item to have while on reserve (optional)
3795
  `ccode_enabled` tinyint(1) NOT NULL DEFAULT 0, -- indicates if ccode should be changed while on course reserve
3794
  `holdingbranch` varchar(10) DEFAULT NULL, -- new holding branch for the item to have while on reserve (optional)
3796
  `holdingbranch` varchar(10) DEFAULT NULL, -- new holding branch for the item to have while on reserve (optional)
3797
  `holdingbranch_enabled` tinyint(1) NOT NULL DEFAULT 0, -- indicates if itype should be changed while on course reserve
3795
  `location` varchar(80) DEFAULT NULL, -- new shelving location for the item to have while on reseve (optional)
3798
  `location` varchar(80) DEFAULT NULL, -- new shelving location for the item to have while on reseve (optional)
3799
  `location_enabled` tinyint(1) NOT NULL DEFAULT 0, -- indicates if itype should be changed while on course reserve
3796
  `enabled` enum('yes','no') NOT NULL DEFAULT 'no', -- if at least one enabled course has this item on reseve, this field will be 'yes', otherwise it will be 'no'
3800
  `enabled` enum('yes','no') NOT NULL DEFAULT 'no', -- if at least one enabled course has this item on reseve, this field will be 'yes', otherwise it will be 'no'
3797
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
3801
  `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
3798
   PRIMARY KEY (`ci_id`),
3802
   PRIMARY KEY (`ci_id`),
3799
- 

Return to bug 23727