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

(-)a/installer/data/mysql/atomicupdate/bug_21674.perl (+12 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    if( !index_exists( 'library_groups', 'library_groups_uniq_2' ) ) {
4
        $dbh->do(q|
5
            ALTER TABLE library_groups
6
            ADD UNIQUE KEY library_groups_uniq_2 (parent_id, branchcode)
7
        |);
8
    }
9
10
    SetVersion( $DBversion );
11
    print "Upgrade to $DBversion done (Bug 21674 - Add unique key (parent_id, branchcode) to library_group)\n";
12
}
(-)a/installer/data/mysql/kohastructure.sql (-2 / +2 lines)
Lines 4287-4293 CREATE TABLE library_groups ( Link Here
4287
    PRIMARY KEY id ( id ),
4287
    PRIMARY KEY id ( id ),
4288
    FOREIGN KEY (parent_id) REFERENCES library_groups(id) ON UPDATE CASCADE ON DELETE CASCADE,
4288
    FOREIGN KEY (parent_id) REFERENCES library_groups(id) ON UPDATE CASCADE ON DELETE CASCADE,
4289
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON UPDATE CASCADE ON DELETE CASCADE,
4289
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON UPDATE CASCADE ON DELETE CASCADE,
4290
    UNIQUE KEY title ( title )
4290
    UNIQUE KEY title ( title ),
4291
    UNIQUE KEY library_groups_uniq_2 ( parent_id, branchcode )
4291
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4292
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4292
4293
4293
--
4294
--
4294
- 

Return to bug 21674