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 (-2 / +6 lines)
Lines 1-8 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
2
if( CheckVersion( $DBversion ) ) {
3
3
4
    $dbh->do( "ALTER TABLE illrequests ADD COLUMN status_alias integer DEFAULT NULL" );
4
    if ( !column_exists( 'illrequests', 'status_alias' ) ) {
5
    $dbh->do( "ALTER TABLE illrequests ADD CONSTRAINT illrequests_safk FOREIGN KEY (status_alias) REFERENCES authorised_values(id) ON DELETE SET NULL" );
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
    }
6
    $dbh->do( "INSERT IGNORE INTO authorised_value_categories SET category_name = 'ILLSTATUS'");
10
    $dbh->do( "INSERT IGNORE INTO authorised_value_categories SET category_name = 'ILLSTATUS'");
7
11
8
    SetVersion( $DBversion );
12
    SetVersion( $DBversion );
(-)a/installer/data/mysql/en/optional/ill_auth_cat.sql (-1 lines)
Line 1 Link Here
1
INSERT IGNORE INTO authorised_value_categories (category_name) VALUES ('ILLSTATUS');
(-)a/installer/data/mysql/en/optional/ill_auth_cat.txt (-1 lines)
Line 1 Link Here
1
Default ILL request status authorised value category name
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 4192-4198 CREATE TABLE illrequests ( Link Here
4192
    CONSTRAINT `illrequests_safk`
4192
    CONSTRAINT `illrequests_safk`
4193
      FOREIGN KEY (`status_alias`)
4193
      FOREIGN KEY (`status_alias`)
4194
      REFERENCES `authorised_values` (`id`)
4194
      REFERENCES `authorised_values` (`id`)
4195
      ON DELETE SET NULL
4195
      ON UPDATE CASCADE ON DELETE SET NULL
4196
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4196
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4197
4197
4198
--
4198
--
(-)a/installer/data/mysql/mandatory/auth_val_cat.sql (-1 / +4 lines)
Lines 57-59 INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES Link Here
57
-- For Housebound
57
-- For Housebound
58
INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES
58
INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES
59
    ('HSBND_FREQ');
59
    ('HSBND_FREQ');
60
- 
60
61
-- For Interlibrary loans
62
INSERT IGNORE INTO authorised_value_categories( category_name ) VALUES
63
    ('ILLSTATUS');

Return to bug 20581