this seems like a waste to remove all the device types if only one of them has changed. can we avoid unnecessary `DELETE` and `INSERT`s?