From 55e2a4e57d676f55cc4c75eb7253931ab4e2c468 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 26 Sep 2019 15:04:38 +0100 Subject: [PATCH] Bug 23049: Add branch limitations tables --- .../data/mysql/atomicupdate/bug_23049_debit.perl | 11 +++++++++++ installer/data/mysql/kohastructure.sql | 12 ++++++++++++ 2 files changed, 23 insertions(+) diff --git a/installer/data/mysql/atomicupdate/bug_23049_debit.perl b/installer/data/mysql/atomicupdate/bug_23049_debit.perl index b83470426a..60d5b0c923 100644 --- a/installer/data/mysql/atomicupdate/bug_23049_debit.perl +++ b/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 ( diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 4a9889bd63..1cb81cb84c 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/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` -- -- 2.20.1