From 6513dcadd0e253be5dd0280d7ac7a95cabad928a 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Séverine QUEUNE --- installer/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 b834704..60d5b0c 100644 --- a/installer/data/mysql/atomicupdate/bug_23049_debit.perl +++ b/installer/data/mysql/atomicupdate/bug_23049_debit.perl @@ -15,6 +15,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 ( code, description, diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 4a9889b..1cb81cb 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2635,6 +2635,18 @@ CREATE TABLE `account_debit_types` ( ) 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.7.4