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 (+10 lines)
Line 0 Link Here
1
$DBversion = 'XXX';  # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    $dbh->do( "ALTER TABLE illrequests ADD COLUMN status_alias integer DEFAULT NULL" );
5
    $dbh->do( "ALTER TABLE illrequests ADD CONSTRAINT illrequests_safk FOREIGN KEY (status_alias) REFERENCES authorised_values(id) ON DELETE SET NULL" );
6
    $dbh->do( "INSERT IGNORE INTO authorised_value_categories SET category_name = 'ILLSTATUS'");
7
8
    SetVersion( $DBversion );
9
    print "Upgrade to $DBversion done (Bug 20581 - Allow manual selection of custom ILL request statuses)\n";
10
}
(-)a/installer/data/mysql/en/optional/ill_auth_cat.sql (+1 lines)
Line 0 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 0 Link Here
1
Default ILL request status authorised value category name
(-)a/installer/data/mysql/kohastructure.sql (-1 / +5 lines)
Lines 4167-4172 CREATE TABLE illrequests ( Link Here
4167
    biblio_id integer DEFAULT NULL,             -- Potential bib linked to request
4167
    biblio_id integer DEFAULT NULL,             -- Potential bib linked to request
4168
    branchcode varchar(50) NOT NULL,            -- The branch associated with the request
4168
    branchcode varchar(50) NOT NULL,            -- The branch associated with the request
4169
    status varchar(50) DEFAULT NULL,            -- Current Koha status of request
4169
    status varchar(50) DEFAULT NULL,            -- Current Koha status of request
4170
    status_alias integer DEFAULT NULL,          -- Foreign key to relevant authorised_values.id
4170
    placed date DEFAULT NULL,                   -- Date the request was placed
4171
    placed date DEFAULT NULL,                   -- Date the request was placed
4171
    replied date DEFAULT NULL,                  -- Last API response
4172
    replied date DEFAULT NULL,                  -- Last API response
4172
    updated timestamp DEFAULT CURRENT_TIMESTAMP -- Last modification to request
4173
    updated timestamp DEFAULT CURRENT_TIMESTAMP -- Last modification to request
Lines 4188-4193 CREATE TABLE illrequests ( Link Here
4188
      FOREIGN KEY (`branchcode`)
4189
      FOREIGN KEY (`branchcode`)
4189
      REFERENCES `branches` (`branchcode`)
4190
      REFERENCES `branches` (`branchcode`)
4190
      ON UPDATE CASCADE ON DELETE CASCADE
4191
      ON UPDATE CASCADE ON DELETE CASCADE
4192
    CONSTRAINT `illrequests_safk`
4193
      FOREIGN KEY (`status_alias`)
4194
      REFERENCES `authorised_values` (`id`)
4195
      ON DELETE SET NULL
4191
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4196
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4192
4197
4193
--
4198
--
4194
- 

Return to bug 20581