adding unique index on type, id, user_id