Added check for foreign keys
Merge pull request #48 from spectralsun/master

Added check for foreign keys