Lesson of the day: when in doubt, transaction all the things #sql