migrate runDb to database module