Bug 9834: Add DB changes

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-06-06 14:49:18 -05:00 committed by Martin Renvoize
parent 0e8a95b4bd
commit 1171a20d05
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
2 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,12 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
unless ( column_exists( 'reserves', 'item_level_hold' ) ) {
$dbh->do( "ALTER TABLE reserves ADD COLUMN item_level_hold BOOLEAN NOT NULL DEFAULT 0 AFTER itemtype" );
}
unless ( column_exists( 'old_reserves', 'item_level_hold' ) ) {
$dbh->do( "ALTER TABLE old_reserves ADD COLUMN item_level_hold BOOLEAN NOT NULL DEFAULT 0 AFTER itemtype" );
}
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 9834 - Add the reserves.item_level_hold column)\n";
}

View file

@ -1882,6 +1882,7 @@ CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha
`suspend` BOOLEAN NOT NULL DEFAULT 0,
`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` BOOLEAN NOT NULL DEFAULT 0, -- Is the hpld placed at item level
PRIMARY KEY (`reserve_id`),
KEY priorityfoundidx (priority,found),
KEY `borrowernumber` (`borrowernumber`),
@ -1921,6 +1922,7 @@ CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b
`suspend` BOOLEAN NOT NULL DEFAULT 0, -- in this hold suspended (1 for yes, 0 for no)
`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` BOOLEAN NOT NULL DEFAULT 0, -- Is the hpld placed at item level
PRIMARY KEY (`reserve_id`),
KEY `old_reserves_borrowernumber` (`borrowernumber`),
KEY `old_reserves_biblionumber` (`biblionumber`),