MDL-70059 core_badges: avoid duplicate key error