Bug 31673: (QA follow-up) Check if FK exists before attempt to remove

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 1c83bd0638)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 4c8ffab563)
Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
This commit is contained in:
Tomas Cohen Arazi 2022-10-11 09:08:56 -03:00 committed by Arthur Suzuki
parent 9cebefa778
commit 12fa274ba7
1 changed files with 6 additions and 3 deletions

View File

@ -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