old_contents: """empty message
  
  Revision ID: bb642928e749
  Revises: cd246fe6ff78
  Create Date: 2021-09-06 21:01:14.987905
  
  """
  from alembic import op
  import sqlalchemy as sa
  
  
  # revision identifiers, used by Alembic.
  revision = "bb642928e749"
  down_revision = "cd246fe6ff78"
  branch_labels = None
  depends_on = None
  
  
  def upgrade() -> None:
      # ### commands auto generated by Alembic - please adjust! ###
      op.create_table(
          "entity",
          sa.Column("name", sa.String(length=255), nullable=False),
          sa.Column("entity_bin", sa.LargeBinary(length=3072), nullable=True),
          sa.PrimaryKeyConstraint("name"),
      )
      op.create_table(
          "mechanism",
          sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
          sa.Column("user_key", sa.LargeBinary(length=2048), nullable=True),
          sa.Column("entity_name", sa.String(length=1024), nullable=True),
          sa.Column("mechanism_bin", sa.LargeBinary(length=3072), nullable=True),
          sa.PrimaryKeyConstraint("id"),
      )
      op.create_table(
          "ledger",
          sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
          sa.Column("entity_name", sa.String(length=256), nullable=True),
          sa.Column("mechanism_id", sa.Integer(), nullable=True),
          sa.ForeignKeyConstraint(
              ["entity_name"], ["entity.name"], ondelete="CASCADE"
          ),
          sa.ForeignKeyConstraint(
              ["mechanism_id"], ["mechanism.id"], ondelete="CASCADE"
          ),
          sa.PrimaryKeyConstraint("id"),
      )
      # ### end Alembic commands ###
  
  
  def downgrade() -> None:
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_table("ledger")
      op.drop_table("mechanism")
      op.drop_table("entity")
      # ### end Alembic commands ###
  
new_contents: """empty message
  
  Revision ID: bb642928e749
  Revises: cd246fe6ff78
  Create Date: 2021-09-06 21:01:14.987905
  
  """
  # third party
  from alembic import op  # type: ignore
  import sqlalchemy as sa
  
  # revision identifiers, used by Alembic.
  revision = "bb642928e749"
  down_revision = "cd246fe6ff78"
  branch_labels = None
  depends_on = None
  
  
  def upgrade() -> None:
      # ### commands auto generated by Alembic - please adjust! ###
      op.create_table(
          "entity",
          sa.Column("name", sa.String(length=255), nullable=False),
          sa.Column("entity_bin", sa.LargeBinary(length=3072), nullable=True),
          sa.PrimaryKeyConstraint("name"),
      )
      op.create_table(
          "mechanism",
          sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
          sa.Column("user_key", sa.LargeBinary(length=2048), nullable=True),
          sa.Column("entity_name", sa.String(length=1024), nullable=True),
          sa.Column("mechanism_bin", sa.LargeBinary(length=3072), nullable=True),
          sa.PrimaryKeyConstraint("id"),
      )
      op.create_table(
          "ledger",
          sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
          sa.Column("entity_name", sa.String(length=256), nullable=True),
          sa.Column("mechanism_id", sa.Integer(), nullable=True),
          sa.ForeignKeyConstraint(["entity_name"], ["entity.name"], ondelete="CASCADE"),
          sa.ForeignKeyConstraint(["mechanism_id"], ["mechanism.id"], ondelete="CASCADE"),
          sa.PrimaryKeyConstraint("id"),
      )
      # ### end Alembic commands ###
  
  
  def downgrade() -> None:
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_table("ledger")
      op.drop_table("mechanism")
      op.drop_table("entity")
      # ### end Alembic commands ###
  
subject: Fix mypy errors