Update database fetching to fetch needed data for previous commit.