Updates database.