From b0d1a27b5d9b1e5917c0b37a6e95d62094da1231 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Mon, 1 Oct 2018 05:30:11 +0000 Subject: [PATCH] Bug 21401: (follow-up) on update set null instead of cascade on transaction library --- .../atomicupdate/bug_21401_account_offsets_transaction_library.perl | 2 +- installer/data/mysql/kohastructure.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_21401_account_offsets_transaction_library.perl b/installer/data/mysql/atomicupdate/bug_21401_account_offsets_transaction_library.perl index f65ffce..faf4d8b 100644 --- a/installer/data/mysql/atomicupdate/bug_21401_account_offsets_transaction_library.perl +++ b/installer/data/mysql/atomicupdate/bug_21401_account_offsets_transaction_library.perl @@ -2,7 +2,7 @@ $DBversion = 'XXX'; # will be replaced by the RM if( CheckVersion( $DBversion ) ) { if( !column_exists( 'account_offsets', 'transaction_library' ) ) { $dbh->do( "ALTER TABLE account_offsets ADD COLUMN transaction_library varchar(10) default NULL AFTER created_on" ); - $dbh->do( "ALTER TABLE account_offsets ADD CONSTRAINT `account_offsets_ibfk_l` FOREIGN KEY (`transaction_library`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE" ); + $dbh->do( "ALTER TABLE account_offsets ADD CONSTRAINT `account_offsets_ibfk_l` FOREIGN KEY (`transaction_library`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE" ); } SetVersion( $DBversion ); diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index b0e37e3..488289e 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -2722,7 +2722,7 @@ CREATE TABLE `account_offsets` ( CONSTRAINT `account_offsets_ibfk_p` FOREIGN KEY (`credit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `account_offsets_ibfk_f` FOREIGN KEY (`debit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE CASCADE ON UPDATE CASCADE, CONSTRAINT `account_offsets_ibfk_t` FOREIGN KEY (`type`) REFERENCES `account_offset_types` (`type`) ON DELETE CASCADE ON UPDATE CASCADE, - CONSTRAINT `account_offsets_ibfk_l` FOREIGN KEY (`transaction_library`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE + CONSTRAINT `account_offsets_ibfk_l` FOREIGN KEY (`transaction_library`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- -- 2.1.4