Writes dependencies to database, need to clean up the format