code: def upgrade():
      bind = op.get_bind()
      session = Session(bind=bind)
  
      # Add the new permissions on the migration itself
      add_pvms(session, NEW_PVMS)
      migrate_roles(session, PVM_MAP)
      try:
          session.commit()
      except SQLAlchemyError as ex:
          print(f"An error occurred while upgrading permissions: {ex}")
          session.rollback()
  
imports: from alembic import op
  from sqlalchemy.exc import SQLAlchemyError
  from sqlalchemy.orm import Session
  from superset.migrations.shared.security_converge import add_pvms, get_reversed_new_pvms, get_reversed_pvm_map, migrate_roles, Pvm
label_desc: Use image node_id 1 for calling a global function with example usage: upgrade() without return types