After_migrate hook problem with implicit commit

Yes, the checking is in Frappe code for a safety reason so I don’t want to override it (which is doable).
As the bench update script can run similar patches like in the bellow discussion, so I just want to find a way to do the same, maybe by turn off the checking, then run, and turn it back on.