[Koha-devel] [RFC ver2 4/4] DBIx::Class - Changes to C4::Members to start using DBIx::Class

Rick Welykochy rick at praxis.com.au
Thu Nov 13 09:06:34 CET 2008


Paul POULAIN wrote:

> one thing that is a real shame is that, atm, if something fails due to 
> FK constraint, the user is NOT warned that something was wrong. he just 
> sees that the data has not be saved. That's really bad !

The INNODB driver for MySQL reports an error if the FK doesn't exist
at creation time.

If by "user" you mean the database client, then yes, there is an error message:

ERROR 1452 (23000): Cannot add or update a child row: a foreign key constraint fails

If by "user" you are referring to the librarian or Koha user, then
it is up to the Koha application to intercept and process the above
error if it does happen and take remedial action, i.e. send an indignant
email to Koha-dev!

Given that you *cannot* create invalid FK relationships in the database,
I don't see how anything could fail using FK constraints. They are a
Good Thing (tm) and are required to avoid orphaned child records
amongst many other things.

cheers
rickw


-- 
________________________________________________________________
Rick Welykochy || Praxis Services || Internet Driving Instructor

When the power of love overcomes the love of power,
the world will know peace.
      -- Jimi Hendrix



More information about the Koha-devel mailing list