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 commit1c83bd0638) Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> (cherry picked from commit4c8ffab563) Signed-off-by: Arthur Suzuki <arthur.suzuki@biblibre.com>
This commit is contained in:
parent
9cebefa778
commit
12fa274ba7
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue