code: def upgrade():
      bind = op.get_bind()
      metadata = sa.MetaData(bind=bind)
      insp = sa.engine.reflection.Inspector.from_engine(bind)
  
      rls_filter_tables = op.create_table(
          "rls_filter_tables",
          sa.Column("id", sa.Integer(), nullable=False),
          sa.Column("table_id", sa.Integer(), nullable=True),
          sa.Column("rls_filter_id", sa.Integer(), nullable=True),
          sa.ForeignKeyConstraint(
              ["rls_filter_id"], ["row_level_security_filters.id"]
          ),
          sa.ForeignKeyConstraint(["table_id"], ["tables.id"]),
          sa.PrimaryKeyConstraint("id"),
      )
  
      rlsf = sa.Table(
          "row_level_security_filters", metadata, autoload=True
      )
      filter_ids = sa.select([rlsf.c.id, rlsf.c.table_id])
  
      for row in bind.execute(filter_ids):
          move_table_id = rls_filter_tables.insert().values(
              rls_filter_id=row["id"], table_id=row["table_id"]
          )
          bind.execute(move_table_id)
  
      with op.batch_alter_table(
          "row_level_security_filters"
      ) as batch_op:
          fk_constraint_name = generic_find_fk_constraint_name(
              "row_level_security_filters", {"id"}, "tables", insp
          )
          if fk_constraint_name:
              batch_op.drop_constraint(
                  fk_constraint_name, type_="foreignkey"
              )
          batch_op.drop_column("table_id")
  
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