Can you please explain exactly what you're doing here? I see that you changed heavily the SQL being generated, but it lacks comments.

Also, if we indeed don't need the flags any more, please also remove them from ```Update.init()```.