Projekti

Yleinen

Profile

Koha-Suomi tietokatojen anonymisointi (SQL-skripti)

Koha-Suomi testikannat voidaan tarvittaessa anonymisoida seuraavanlaisella skriptillä:

set autocommit=off;
start transaction;

update borrowers set borrowernotes=null, opacnote=null, sex=null, dateofbirth=null, contactname=null, contactfirstname=null, othernames=null, firstname="*****", surname="*****", address="*****", city="*****", zipcode="*****", phone="*****", mobile="*****", email="*****", smsalertnumber="*****";
update deletedborrowers set borrowernotes=null, opacnote=null, sex=null, dateofbirth=null, contactname=null, contactfirstname=null, othernames=null, firstname="*****", surname="*****", address="*****", city="*****", zipcode="*****", phone="*****", mobile="*****", email="*****", smsalertnumber="*****";

set foreign_key_checks=0;
truncate table message_queue;
set foreign_key_checks=1;

delete from borrower_attributes where code='SSN';
delete from borrower_modifications;

truncate table search_history;
truncate table sessions;

commit;

Skripti korvaa kaikki asiakkaan identifioivat tiedot tähtimerkeillä (*), joten asiakashaku ei luonnollisesti anonymisoinnin jälkeen palauta enää mitään. Kirjastokorttien numerot jäävät ennalleen, joten niillä voidaan hakea.