code: def upgrade():
      bind = op.get_bind()
      insp = sa.engine.reflection.Inspector.from_engine(bind)
  
      with op.batch_alter_table("tab_state") as batch_op:
          batch_op.drop_constraint(
              generic_find_fk_constraint_name(
                  "tab_state", {"id"}, "saved_query", insp
              ),
              type_="foreignkey",
          )
  
          batch_op.create_foreign_key(
              "saved_query_id",
              "saved_query",
              ["saved_query_id"],
              ["id"],
              ondelete="SET NULL",
          )
  
imports: import sqlalchemy
  from alembic import op
  from superset.utils.core import generic_find_fk_constraint_name
label_desc: Use image node_id 1 for calling a global function with example usage: upgrade() without return types