A database that will be a central part of the ID card scheme has suffered more than 30 breaches.