From 52abdec5ba060764d77e84df389205b609e12457 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Thu, 20 Sep 2018 11:14:54 +0000 Subject: [PATCH] Bug 18606: (follow-up) Do not add contraints in kohastructure.sql separately --- installer/data/mysql/kohastructure.sql | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 17e6092..f355916 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -319,16 +319,11 @@ CREATE TABLE collections ( colTitle varchar(100) NOT NULL DEFAULT '', colDesc MEDIUMTEXT NOT NULL, colBranchcode varchar(10) DEFAULT NULL, -- 'branchcode for branch where item should be held.' - PRIMARY KEY (colId) + PRIMARY KEY (colId), + CONSTRAINT `collections_ibfk_1` FOREIGN KEY (`colBranchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCAD E ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- --- Constraints for table `collections` --- -ALTER TABLE `collections` - ADD CONSTRAINT `collections_ibfk_1` FOREIGN KEY (`colBranchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE; - --- -- Table structure for table `branch_borrower_circ_rules` -- @@ -971,15 +966,11 @@ CREATE TABLE collections_tracking ( collections_tracking_id integer(11) NOT NULL auto_increment, colId integer(11) NOT NULL DEFAULT 0 comment 'collections.colId', itemnumber integer(11) NOT NULL DEFAULT 0 comment 'items.itemnumber', - PRIMARY KEY (collections_tracking_id) + PRIMARY KEY (collections_tracking_id), + CONSTRAINT `collections_tracking_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `collections_tracking_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CAS CADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -ALTER TABLE `collections_tracking` - ADD CONSTRAINT `collections_tracking_ibfk_1` FOREIGN KEY (`colId`) REFERENCES `collections` (`colId`) ON DELETE CASCADE ON UPDATE CASCADE; - -ALTER TABLE `collections_tracking` - ADD CONSTRAINT `collections_tracking_ibfk_2` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE; - -- -- Table structure for table `default_branch_item_rules` -- -- 2.1.4