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 4280-4286 CREATE TABLE library_groups ( Link Here
4280
    PRIMARY KEY id ( id ),
4280
    PRIMARY KEY id ( id ),
4281
    FOREIGN KEY (parent_id) REFERENCES library_groups(id) ON UPDATE CASCADE ON DELETE CASCADE,
4281
    FOREIGN KEY (parent_id) REFERENCES library_groups(id) ON UPDATE CASCADE ON DELETE CASCADE,
4282
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON UPDATE CASCADE ON DELETE CASCADE,
4282
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON UPDATE CASCADE ON DELETE CASCADE,
4283
    UNIQUE KEY title ( title )
4283
    UNIQUE KEY title ( title ),
4284
    UNIQUE KEY library_groups_uniq_2 ( parent_id, branchcode )
4284
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4285
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4285
4286
4286
--
4287
--
4287
- 

Return to bug 21674