diff --git a/installer/data/mysql/db_revs/211112000.pl b/installer/data/mysql/db_revs/211112000.pl index b023204410..e8999a10de 100644 --- a/installer/data/mysql/db_revs/211112000.pl +++ b/installer/data/mysql/db_revs/211112000.pl @@ -32,9 +32,12 @@ return { }); # Remove FOREIGN KEY CONSTRAINT - $dbh->do(q{ - ALTER TABLE reserves DROP FOREIGN KEY reserves_ibfk_4; - }); + if ( foreign_key_exists( 'reserves', 'reserves_ibfk_4' ) ) { + $dbh->do(q{ + ALTER TABLE reserves DROP FOREIGN KEY reserves_ibfk_4; + }); + } + # Set the NOT NULL configuration $dbh->do(q{ ALTER TABLE reserves