[NTG-context] automatically regenerate database before making format