There's a race between (1) and (3) where new entries could be created (increasing the max primary key value) before the triggers are in place.
There's a race between (1) and (3) where new entries could be created (increasing the max primary key value) before the triggers are in place.