From alembic migration version script, I added line below to surpass event trigger. My question is do I need to reregister at the end of the script? Or migration is using totally different session from the entire application, so it won't matter.
from alembic import op
from sqlalchemy.orm.session import Session
from sqlalchemy import event
def upgrade():
session = Session(bind=op.get_bind())
event.remove(SomeModel, 'after_insert', after_insert_handle)
...
event.listen(SomeModel, 'after_insert', after_insert_handle) # this line necessary?
session.commit()