From be9966aeeb06287a3dff30a7829cd06639086ced Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 26 Apr 2016 15:45:38 +0000 Subject: [PATCH] [SIGNED-OFF] Bug 16354 - TestBuilder.t fails due to key constraints Test Plan: 1) prove t/db_dependent/TestBuilder.t 2) Note failure 3) Apply this patch 4) prove t/db_dependent/TestBuilder.t 5) Tests should now pass! Signed-off-by: Bernardo Gonzalez Kriegel Failure noted and corrected. No errors --- installer/data/mysql/atomicupdate/bug_16354.sql | 9 +++++++++ installer/data/mysql/kohastructure.sql | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 installer/data/mysql/atomicupdate/bug_16354.sql diff --git a/installer/data/mysql/atomicupdate/bug_16354.sql b/installer/data/mysql/atomicupdate/bug_16354.sql new file mode 100644 index 0000000..768bd1d --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_16354.sql @@ -0,0 +1,9 @@ +ALTER TABLE edifact_messages + DROP FOREIGN KEY emfk_vendor, + DROP FOREIGN KEY emfk_edi_acct, + DROP FOREIGN KEY emfk_basketno; + +ALTER TABLE edifact_messages + ADD CONSTRAINT emfk_vendor FOREIGN KEY ( vendor_id ) REFERENCES aqbooksellers ( id ) ON DELETE CASCADE ON UPDATE CASCADE, + ADD CONSTRAINT emfk_edi_acct FOREIGN KEY ( edi_acct ) REFERENCES vendor_edi_accounts ( id ) ON DELETE CASCADE ON UPDATE CASCADE, + ADD CONSTRAINT emfk_basketno FOREIGN KEY ( basketno ) REFERENCES aqbasket ( basketno ) ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 242755d..0111c09 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -3223,9 +3223,9 @@ CREATE TABLE IF NOT EXISTS edifact_messages ( KEY vendorid ( vendor_id), KEY ediacct (edi_acct), KEY basketno ( basketno), - CONSTRAINT emfk_vendor FOREIGN KEY ( vendor_id ) REFERENCES aqbooksellers ( id ), - CONSTRAINT emfk_edi_acct FOREIGN KEY ( edi_acct ) REFERENCES vendor_edi_accounts ( id ), - CONSTRAINT emfk_basketno FOREIGN KEY ( basketno ) REFERENCES aqbasket ( basketno ) + CONSTRAINT emfk_vendor FOREIGN KEY ( vendor_id ) REFERENCES aqbooksellers ( id ) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT emfk_edi_acct FOREIGN KEY ( edi_acct ) REFERENCES vendor_edi_accounts ( id ) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT emfk_basketno FOREIGN KEY ( basketno ) REFERENCES aqbasket ( basketno ) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; -- -- 1.9.1