Database actions for users & history (partial)