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

(-)a/installer/data/mysql/atomicupdate/bug_15497.perl (+17 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
4
    if( !TableExists( 'itemtypes_branches' ) ) {
5
       $dbh->do( "
6
            CREATE TABLE itemtypes_branches( -- association table between authorised_values and branches
7
                itemtype VARCHAR(10) NOT NULL,
8
                branchcode VARCHAR(10) NOT NULL,
9
                FOREIGN KEY (itemtype) REFERENCES itemtypes(itemtype) ON DELETE CASCADE,
10
                FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
11
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
12
        ");
13
    }
14
15
    SetVersion( $DBversion );
16
    print "Upgrade to $DBversion done (Bug 15497 - Add itemtypes_branches table)\n";
17
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +12 lines)
Lines 4287-4292 shortcut_keys varchar(80) NOT NULL, Link Here
4287
PRIMARY KEY (shortcut_name)
4287
PRIMARY KEY (shortcut_name)
4288
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4288
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4289
4289
4290
--
4291
-- Table structure for table itemtypes_branches
4292
--
4293
4294
DROP TABLE IF EXISTS itemtypes_branches;
4295
CREATE TABLE itemtypes_branches( -- association table between authorised_values and branches
4296
    itemtype VARCHAR(10) NOT NULL,
4297
    branchcode VARCHAR(10) NOT NULL,
4298
    FOREIGN KEY (itemtype) REFERENCES itemtypes(itemtype) ON DELETE CASCADE,
4299
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
4300
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4301
4290
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4302
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4291
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4303
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4292
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4304
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4293
- 

Return to bug 15497