MySQL AUTO_INCREMENT updates
I just found out the painful way that if you manually update a column which is normally calculated automatically as an auto_increment it seems to work at first ..
but MySQL doesn’t update the auto_increment value for the table - so subsequent inserts can fail.