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

(-)a/installer/data/mysql/atomicupdate/bug_20581-add_new_illrequests_status_alias_column.perl (+14 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    if ( !column_exists( 'illrequests', 'status_alias' ) ) {
5
        $dbh->do( "ALTER TABLE illrequests ADD COLUMN status_alias integer DEFAULT NULL AFTER status" );
6
    }
7
    if ( !foreign_key_exists( 'illrequests', 'illrequests_safk' ) ) {
8
        $dbh->do( "ALTER TABLE illrequests ADD CONSTRAINT illrequests_safk FOREIGN KEY (status_alias) REFERENCES authorised_values(id) ON UPDATE CASCADE ON DELETE SET NULL" );
9
    }
10
    $dbh->do( "INSERT IGNORE INTO authorised_value_categories SET category_name = 'ILLSTATUS'");
11
12
    SetVersion( $DBversion );
13
    print "Upgrade to $DBversion done (Bug 20581 - Allow manual selection of custom ILL request statuses)\n";
14
}
(-)a/installer/data/mysql/kohastructure.sql (+5 lines)
Lines 4171-4176 CREATE TABLE illrequests ( Link Here
4171
    biblio_id integer DEFAULT NULL,             -- Potential bib linked to request
4171
    biblio_id integer DEFAULT NULL,             -- Potential bib linked to request
4172
    branchcode varchar(50) NOT NULL,            -- The branch associated with the request
4172
    branchcode varchar(50) NOT NULL,            -- The branch associated with the request
4173
    status varchar(50) DEFAULT NULL,            -- Current Koha status of request
4173
    status varchar(50) DEFAULT NULL,            -- Current Koha status of request
4174
    status_alias integer DEFAULT NULL,          -- Foreign key to relevant authorised_values.id
4174
    placed date DEFAULT NULL,                   -- Date the request was placed
4175
    placed date DEFAULT NULL,                   -- Date the request was placed
4175
    replied date DEFAULT NULL,                  -- Last API response
4176
    replied date DEFAULT NULL,                  -- Last API response
4176
    updated timestamp DEFAULT CURRENT_TIMESTAMP -- Last modification to request
4177
    updated timestamp DEFAULT CURRENT_TIMESTAMP -- Last modification to request
Lines 4192-4197 CREATE TABLE illrequests ( Link Here
4192
      FOREIGN KEY (`branchcode`)
4193
      FOREIGN KEY (`branchcode`)
4193
      REFERENCES `branches` (`branchcode`)
4194
      REFERENCES `branches` (`branchcode`)
4194
      ON UPDATE CASCADE ON DELETE CASCADE
4195
      ON UPDATE CASCADE ON DELETE CASCADE
4196
    CONSTRAINT `illrequests_safk`
4197
      FOREIGN KEY (`status_alias`)
4198
      REFERENCES `authorised_values` (`id`)
4199
      ON UPDATE CASCADE ON DELETE SET NULL
4195
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4200
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4196
4201
4197
--
4202
--
(-)a/installer/data/mysql/mandatory/auth_val_cat.sql (-1 / +4 lines)
Lines 58-60 INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES Link Here
58
-- For Housebound
58
-- For Housebound
59
INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES
59
INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES
60
    ('HSBND_FREQ');
60
    ('HSBND_FREQ');
61
- 
61
62
-- For Interlibrary loans
63
INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES
64
    ('ILLSTATUS');

Return to bug 20581