From 8b6f03662f3a18c3a886e00aa5bd1f2ce2c14d1c Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 3 Jan 2024 09:31:59 -0500 Subject: [PATCH] Bug 35687: Fix db rev for 23.06.00.013 Signed-off-by: Emily Lamancusa --- installer/data/mysql/db_revs/230600013.pl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/db_revs/230600013.pl b/installer/data/mysql/db_revs/230600013.pl index 55a7db5827..e9b4aca87e 100755 --- a/installer/data/mysql/db_revs/230600013.pl +++ b/installer/data/mysql/db_revs/230600013.pl @@ -8,8 +8,14 @@ return { my ( $dbh, $out ) = @$args{qw(dbh out)}; unless ( primary_key_exists( 'tmp_holdsqueue', 'itemnumber' ) ) { + $dbh->do(q{ALTER TABLE tmp_holdsqueue DROP CONSTRAINT `tmp_holdsqueue_ibfk_1`}); + $dbh->do(q{ALTER TABLE tmp_holdsqueue ADD PRIMARY KEY (itemnumber)}); $dbh->do( - q{ALTER TABLE tmp_holdsqueue ADD PRIMARY KEY (itemnumber)} + q{ + ALTER TABLE tmp_holdsqueue ADD CONSTRAINT `tmp_holdsqueue_ibfk_1` + FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) + ON DELETE CASCADE ON UPDATE CASCADE + } ); } -- 2.34.1