@@ -, +, @@ old_reserves --- installer/data/mysql/atomicupdate/bug_22789.perl | 14 ++++++++++++++ installer/data/mysql/kohastructure.sql | 2 ++ 2 files changed, 16 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_22789.perl --- a/installer/data/mysql/atomicupdate/bug_22789.perl +++ a/installer/data/mysql/atomicupdate/bug_22789.perl @@ -0,0 +1,14 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + # you can use $dbh here like: + # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" ); + + # or perform some test and warn + if( !column_exists( 'reserves', 'non_priority' ) ) { + $dbh->do("ALTER TABLE reserves ADD COLUMN `non_priority` tinyint(1) NOT NULL DEFAULT 0 AFTER `item_level_hold` -- Is this a non priority hold"); + $dbh->do("ALTER TABLE old_reserves ADD COLUMN `non_priority` tinyint(1) NOT NULL DEFAULT 0 AFTER `item_level_hold` -- Is this a non priority hold"); + } + + # Always end with this (adjust the bug info) + NewVersion( $DBversion, 22789, "Add non_priority column on reserves and old_reserves tables"); +} --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -1772,6 +1772,7 @@ CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha `suspend_until` DATETIME NULL DEFAULT NULL, `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting `item_level_hold` tinyint(1) NOT NULL DEFAULT 0, -- Is the hpld placed at item level + `non_priority` tinyint(1) NOT NULL DEFAULT 0, -- Is this a non priority hold PRIMARY KEY (`reserve_id`), KEY priorityfoundidx (priority,found), KEY `borrowernumber` (`borrowernumber`), @@ -1812,6 +1813,7 @@ CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely) `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting `item_level_hold` tinyint(1) NOT NULL DEFAULT 0, -- Is the hpld placed at item level + `non_priority` tinyint(1) NOT NULL DEFAULT 0, -- Is this a non priority hold PRIMARY KEY (`reserve_id`), KEY `old_reserves_borrowernumber` (`borrowernumber`), KEY `old_reserves_biblionumber` (`biblionumber`), --