copy beta2 logic for DatabaseGeneratedOption