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

(-)a/installer/data/mysql/atomicupdate/bug_22789.perl (+14 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    # you can use $dbh here like:
4
    # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" );
5
6
    # or perform some test and warn
7
    if( !column_exists( 'reserves', 'non_priority' ) ) {
8
        $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");
9
        $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");
10
    }
11
12
    # Always end with this (adjust the bug info)
13
    NewVersion( $DBversion, 22789, "Add non_priority column on reserves and old_reserves tables");
14
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +2 lines)
Lines 1773-1778 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1773
  `suspend_until` DATETIME NULL DEFAULT NULL,
1773
  `suspend_until` DATETIME NULL DEFAULT NULL,
1774
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1774
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1775
  `item_level_hold` tinyint(1) NOT NULL DEFAULT 0, -- Is the hpld placed at item level
1775
  `item_level_hold` tinyint(1) NOT NULL DEFAULT 0, -- Is the hpld placed at item level
1776
  `non_priority` tinyint(1) NOT NULL DEFAULT 0, -- Is this a non priority hold
1776
  PRIMARY KEY (`reserve_id`),
1777
  PRIMARY KEY (`reserve_id`),
1777
  KEY priorityfoundidx (priority,found),
1778
  KEY priorityfoundidx (priority,found),
1778
  KEY `borrowernumber` (`borrowernumber`),
1779
  KEY `borrowernumber` (`borrowernumber`),
Lines 1814-1819 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1814
  `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely)
1815
  `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely)
1815
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1816
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1816
  `item_level_hold` tinyint(1) NOT NULL DEFAULT 0, -- Is the hpld placed at item level
1817
  `item_level_hold` tinyint(1) NOT NULL DEFAULT 0, -- Is the hpld placed at item level
1818
  `non_priority` tinyint(1) NOT NULL DEFAULT 0, -- Is this a non priority hold
1817
  PRIMARY KEY (`reserve_id`),
1819
  PRIMARY KEY (`reserve_id`),
1818
  KEY `old_reserves_borrowernumber` (`borrowernumber`),
1820
  KEY `old_reserves_borrowernumber` (`borrowernumber`),
1819
  KEY `old_reserves_biblionumber` (`biblionumber`),
1821
  KEY `old_reserves_biblionumber` (`biblionumber`),
1820
- 

Return to bug 22789