fix scripts to define primary key to cache