update code and database