Fixed regex for foreign key query. Added on_update/on_delete keys and testing for them.