fixing lack of cascading delete on generic foreign keys
date formatting