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

(-)a/installer/data/mysql/atomicupdate/bug_22440_ill_requests.pl (+19 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "22440",
5
    description => "Add new /ill_requests endopoint",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        if ( foreign_key_exists( 'illrequests', 'illrequests_bibfk' ) ) {
11
            $dbh->do(q{
12
                ALTER TABLE illrequests
13
                    ADD FOREIGN KEY illrequests_bibfk (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE;
14
            });
15
16
            say $out "Added foreign key constraint 'illrequests.illrequests_bibfk'";
17
        }
18
    },
19
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 3282-3287 CREATE TABLE `illrequests` ( Link Here
3282
  KEY `illrequests_bnfk` (`borrowernumber`),
3282
  KEY `illrequests_bnfk` (`borrowernumber`),
3283
  KEY `illrequests_bcfk_2` (`branchcode`),
3283
  KEY `illrequests_bcfk_2` (`branchcode`),
3284
  KEY `illrequests_safk` (`status_alias`),
3284
  KEY `illrequests_safk` (`status_alias`),
3285
  CONSTRAINT `illrequests_bibfk` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
3285
  CONSTRAINT `illrequests_bcfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
3286
  CONSTRAINT `illrequests_bcfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
3286
  CONSTRAINT `illrequests_bnfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
3287
  CONSTRAINT `illrequests_bnfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
3287
  CONSTRAINT `illrequests_safk` FOREIGN KEY (`status_alias`) REFERENCES `authorised_values` (`authorised_value`) ON DELETE SET NULL ON UPDATE CASCADE
3288
  CONSTRAINT `illrequests_safk` FOREIGN KEY (`status_alias`) REFERENCES `authorised_values` (`authorised_value`) ON DELETE SET NULL ON UPDATE CASCADE
3288
- 

Return to bug 22440