finished database integration for PR storage