https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34276 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl --- Comment #35 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Note this change on bug 29390 (waiting in NSO since June): sub foreign_key_exists { - my ( $table_name, $constraint_name ) = @_; + my ( $table_name, $constraint_name, $field_name ) = @_; my $dbh = C4::Context->dbh; my (undef, $infos) = $dbh->selectrow_array(qq|SHOW CREATE TABLE $table_name|); - return $infos =~ m|CONSTRAINT `$constraint_name` FOREIGN KEY|; + return $infos =~ m|CONSTRAINT `$constraint_name` FOREIGN KEY| if $constraint_name; + return $infos =~ m|FOREIGN KEY \(`$field_name`\)| if $field_name; } This allows me to check for a FK without the specific constraint name.. -- You are receiving this mail because: You are watching all bug changes.