write achievements to database