The Department class now correctly checks foreign keys

We were not checking all possible foreign keys before.  This had to be a raw SQL command.
Fixes #121