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 4288-4293 shortcut_keys varchar(80) NOT NULL, Link Here
4288
PRIMARY KEY (shortcut_name)
4288
PRIMARY KEY (shortcut_name)
4289
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4289
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4290
4290
4291
--
4292
-- Table structure for table itemtypes_branches
4293
--
4294
4295
DROP TABLE IF EXISTS itemtypes_branches;
4296
CREATE TABLE itemtypes_branches( -- association table between authorised_values and branches
4297
    itemtype VARCHAR(10) NOT NULL,
4298
    branchcode VARCHAR(10) NOT NULL,
4299
    FOREIGN KEY (itemtype) REFERENCES itemtypes(itemtype) ON DELETE CASCADE,
4300
    FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE
4301
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4302
4291
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4303
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4292
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4304
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4293
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4305
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4294
- 

Return to bug 15497