Move note id counter to databse