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 1772-1777 CREATE TABLE `reserves` ( -- information related to holds/reserves in Koha Link Here
1772
  `suspend_until` DATETIME NULL DEFAULT NULL,
1772
  `suspend_until` DATETIME NULL DEFAULT NULL,
1773
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1773
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1774
  `item_level_hold` tinyint(1) NOT NULL DEFAULT 0, -- Is the hpld placed at item level
1774
  `item_level_hold` tinyint(1) NOT NULL DEFAULT 0, -- Is the hpld placed at item level
1775
  `non_priority` tinyint(1) NOT NULL DEFAULT 0, -- Is this a non priority hold
1775
  PRIMARY KEY (`reserve_id`),
1776
  PRIMARY KEY (`reserve_id`),
1776
  KEY priorityfoundidx (priority,found),
1777
  KEY priorityfoundidx (priority,found),
1777
  KEY `borrowernumber` (`borrowernumber`),
1778
  KEY `borrowernumber` (`borrowernumber`),
Lines 1812-1817 CREATE TABLE `old_reserves` ( -- this table holds all holds/reserves that have b Link Here
1812
  `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely)
1813
  `suspend_until` DATETIME NULL DEFAULT NULL, -- the date this hold is suspended until (NULL for infinitely)
1813
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1814
  `itemtype` VARCHAR(10) NULL DEFAULT NULL, -- If record level hold, the optional itemtype of the item the patron is requesting
1814
  `item_level_hold` tinyint(1) NOT NULL DEFAULT 0, -- Is the hpld placed at item level
1815
  `item_level_hold` tinyint(1) NOT NULL DEFAULT 0, -- Is the hpld placed at item level
1816
  `non_priority` tinyint(1) NOT NULL DEFAULT 0, -- Is this a non priority hold
1815
  PRIMARY KEY (`reserve_id`),
1817
  PRIMARY KEY (`reserve_id`),
1816
  KEY `old_reserves_borrowernumber` (`borrowernumber`),
1818
  KEY `old_reserves_borrowernumber` (`borrowernumber`),
1817
  KEY `old_reserves_biblionumber` (`biblionumber`),
1819
  KEY `old_reserves_biblionumber` (`biblionumber`),
1818
- 

Return to bug 22789