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

(-)a/installer/data/mysql/db_revs/221200026.pl (-1 / +1 lines)
Lines 31-37 return { Link Here
31
            $dbh->do(q{
31
            $dbh->do(q{
32
                ALTER TABLE illrequests
32
                ALTER TABLE illrequests
33
                    ADD KEY `illrequests_bibfk` (`biblio_id`),
33
                    ADD KEY `illrequests_bibfk` (`biblio_id`),
34
                    ADD FOREIGN KEY illrequests_bibfk (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE;
34
                    ADD CONSTRAINT illrequests_bibfk FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE;
35
            });
35
            });
36
36
37
            say $out "Added foreign key constraint 'illrequests.illrequests_bibfk'";
37
            say $out "Added foreign key constraint 'illrequests.illrequests_bibfk'";
(-)a/installer/data/mysql/db_revs/230600002.pl (-3 / +24 lines)
Lines 27-37 return { Link Here
27
                  AND illrequests.biblio_id IS NOT NULL
27
                  AND illrequests.biblio_id IS NOT NULL
28
        });
28
        });
29
29
30
        unless ( foreign_key_exists( 'illrequests', 'illrequests_bibfk' ) ) {
30
        if ( foreign_key_exists( 'illrequests', 'illrequests_ibfk_1' ) ) {
31
            $dbh->do(q{
32
                ALTER TABLE illrequests
33
                DROP FOREIGN KEY illrequests_ibfk_1
34
            });
35
        }
36
37
        if (   !foreign_key_exists( 'illrequests', 'illrequests_bibfk' )
38
            || !index_exists('illrequests', 'illrequests_bibfk') ) {
39
40
            if ( foreign_key_exists( 'illrequests', 'illrequests_bibfk' ) ) {
41
                $dbh->do(q{
42
                    ALTER TABLE illrequests
43
                    DROP FOREIGN KEY illrequests_bibfk
44
                });
45
            }
46
            if (index_exists('illrequests', 'illrequests_bibfk')) {
47
                $dbh->do(q{
48
                    ALTER TABLE illrequests
49
                    DROP INDEX illrequests_bibfk
50
                });
51
            }
52
31
            $dbh->do(q{
53
            $dbh->do(q{
32
                ALTER TABLE illrequests
54
                ALTER TABLE illrequests
33
                    ADD KEY `illrequests_bibfk` (`biblio_id`),
55
                    ADD KEY `illrequests_bibfk` (`biblio_id`),
34
                    ADD FOREIGN KEY illrequests_bibfk (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE;
56
                    ADD CONSTRAINT illrequests_bibfk FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE;
35
            });
57
            });
36
58
37
            say $out "Added foreign key constraint 'illrequests.illrequests_bibfk'";
59
            say $out "Added foreign key constraint 'illrequests.illrequests_bibfk'";
38
- 

Return to bug 34276