code: def upgrade():
      op.add_column(
          "datasources",
          Column("schema_perm", String(length=1000), nullable=True),
      )
      op.add_column(
          "slices",
          Column("schema_perm", String(length=1000), nullable=True),
      )
      op.add_column(
          "tables",
          Column("schema_perm", String(length=1000), nullable=True),
      )
  
      bind = op.get_bind()
      session = db.Session(bind=bind)
      for t in session.query(Sqlatable).all():
          db_name = (
              t.database.verbose_name
              if t.database.verbose_name
              else t.database.database_name
          )
          if t.schema:
              t.schema_perm = f"[{db_name}].[{t.schema}]"
              table_slices = (
                  session.query(Slice)
                  .filter_by(datasource_type="table")
                  .filter_by(datasource_id=t.id)
                  .all()
              )
              for s in table_slices:
                  s.schema_perm = t.schema_perm
      session.commit()
  
file_path: superset/superset/migrations/versions/2019-09-11_21-49_5afa9079866a_serialize_schema_permissions_py.py
imports: from alembic import op
  from sqlalchemy import Column, ForeignKey, Integer, String
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy.orm import relationship
  from superset import db
label_desc: Use image node_id 1 for calling a global function with example usage: upgrade() without return types