@@ -, +, @@ --- .../data/mysql/atomicupdate/bug_23727.perl | 20 +++++++++++++++++++ installer/data/mysql/kohastructure.sql | 4 ++++ 2 files changed, 24 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_23727.perl --- a/installer/data/mysql/atomicupdate/bug_23727.perl +++ a/installer/data/mysql/atomicupdate/bug_23727.perl @@ -0,0 +1,20 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + if ( !column_exists( 'course_items', 'itype_enabled' ) ) { + $dbh->do(q{ + ALTER TABLE course_items ADD COLUMN itype_enabled tinyint(1) NOT NULL DEFAULT 0 AFTER itype; + }); + $dbh->do(q{ + ALTER TABLE course_items ADD COLUMN ccode_enabled tinyint(1) NOT NULL DEFAULT 0 AFTER ccode; + }); + $dbh->do(q{ + ALTER TABLE course_items ADD COLUMN holdingbranch_enabled tinyint(1) NOT NULL DEFAULT 0 AFTER holdingbranch; + }); + $dbh->do(q{ + ALTER TABLE course_items ADD COLUMN location_enabled tinyint(1) NOT NULL DEFAULT 0 AFTER location; + }); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 23727 - Editing course reserve items is broken)\n"; +} --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -3790,9 +3790,13 @@ CREATE TABLE `course_items` ( `ci_id` int(11) NOT NULL AUTO_INCREMENT, -- course item id `itemnumber` int(11) NOT NULL, -- items.itemnumber for the item on reserve `itype` varchar(10) DEFAULT NULL, -- new itemtype for the item to have while on reserve (optional) + `itype_enabled` tinyint(1) NOT NULL DEFAULT 0, -- indicates if itype should be changed while on course reserve `ccode` varchar(80) DEFAULT NULL, -- new category code for the item to have while on reserve (optional) + `ccode_enabled` tinyint(1) NOT NULL DEFAULT 0, -- indicates if ccode should be changed while on course reserve `holdingbranch` varchar(10) DEFAULT NULL, -- new holding branch for the item to have while on reserve (optional) + `holdingbranch_enabled` tinyint(1) NOT NULL DEFAULT 0, -- indicates if itype should be changed while on course reserve `location` varchar(80) DEFAULT NULL, -- new shelving location for the item to have while on reseve (optional) + `location_enabled` tinyint(1) NOT NULL DEFAULT 0, -- indicates if itype should be changed while on course reserve `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' `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, PRIMARY KEY (`ci_id`), --