adds unique indexes and performs update on existing records