fix db_gen