Added cascade functionality to the database models