fixed error when using foreign keys

Changed truncate to delete and it now works :-)