@@ -, +, @@ --- .../data/mysql/atomicupdate/bug_23049_debit.perl | 11 +++++++++++ installer/data/mysql/kohastructure.sql | 12 ++++++++++++ 2 files changed, 23 insertions(+) --- a/installer/data/mysql/atomicupdate/bug_23049_debit.perl +++ a/installer/data/mysql/atomicupdate/bug_23049_debit.perl @@ -13,6 +13,17 @@ if ( CheckVersion($DBversion) ) { } ); + $dbh->do( + qq{ + CREATE TABLE IF NOT EXISTS ac_debit_types_branches ( + debit_type_code VARCHAR(16), + branchcode VARCHAR(10), + FOREIGN KEY (debit_type_code) REFERENCES account_debit_types(code) ON DELETE CASCADE, + FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci + } + ); + $dbh->do( qq{ INSERT IGNORE INTO account_debit_types ( --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -2634,6 +2634,18 @@ CREATE TABLE `account_debit_types` ( PRIMARY KEY (`code`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; +-- +-- Table structure for table `ac_debit_types_branches` +-- + +DROP TABLE IF EXISTS `ac_debit_types_branches`; +CREATE TABLE `ac_debit_types_branches` ( + `debit_type_code` VARCHAR(16), + `branchcode` VARCHAR(10), + FOREIGN KEY (`debit_type_code`) REFERENCES `account_debit_types` (`code`) ON DELETE CASCADE, + FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; + -- -- Table structure for table `accountlines` -- --