text: """record model
  
  Revision ID: 6c2a16b349b1
  Revises: 2bafd0d01ae2
  Create Date: 2021-11-20 18:51:45.427996
  
  """
  import sqlalchemy as sa
  import sqlmodel
  import sqlmodel.sql.sqltypes
  from alembic import op
  
  # revision identifiers, used by Alembic.
  revision = "6c2a16b349b1"
  down_revision = "2bafd0d01ae2"
  branch_labels = None
  depends_on = None
  
  
  def upgrade() -> None:
      # ### commands auto generated by Alembic - please adjust! ###
      op.create_table(
          "records",
          sa.Column(
              "created_at",
              sa.DateTime(timezone=True),
              server_default=sa.text("TIMEZONE('utc', CURRENT_TIMESTAMP)"),
              nullable=False,
          ),
          sa.Column(
              "updated_at",
              sa.DateTime(timezone=True),
              server_default=sa.text("TIMEZONE('utc', CURRENT_TIMESTAMP)"),
              nullable=False,
          ),
          sa.Column("problem_set_id", sqlmodel.sql.sqltypes.GUID(), nullable=True),
          sa.Column("problem_id", sqlmodel.sql.sqltypes.GUID(), nullable=True),
          sa.Column("user_id", sqlmodel.sql.sqltypes.GUID(), nullable=True),
          sa.Column("id", sqlmodel.sql.sqltypes.GUID(), nullable=False),
          sa.Column("status", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
          sa.Column("score", sa.Integer(), nullable=True),
          sa.Column("time_ms", sa.Integer(), nullable=True),
          sa.Column("memory_kb", sa.Integer(), nullable=True),
          sa.Column("commit_id", sqlmodel.sql.sqltypes.AutoString(), nullable=True),
          sa.ForeignKeyConstraint(["problem_id"], ["problems.id"], ondelete="SET NULL"),
          sa.ForeignKeyConstraint(
              ["problem_set_id"], ["problem_sets.id"], ondelete="SET NULL"
          ),
          sa.ForeignKeyConstraint(["user_id"], ["users.id"], ondelete="SET NULL"),
          sa.PrimaryKeyConstraint("id"),
      )
      op.create_index(
          op.f("ix_records_commit_id"), "records", ["commit_id"], unique=False
      )
      op.create_index(
          op.f("ix_records_created_at"), "records", ["created_at"], unique=False
      )
      op.create_index(op.f("ix_records_id"), "records", ["id"], unique=False)
      op.create_index(
          op.f("ix_records_memory_kb"), "records", ["memory_kb"], unique=False
      )
      op.create_index(op.f("ix_records_score"), "records", ["score"], unique=False)
      op.create_index(op.f("ix_records_status"), "records", ["status"], unique=False)
      op.create_index(op.f("ix_records_time_ms"), "records", ["time_ms"], unique=False)
      op.create_index(
          op.f("ix_records_updated_at"), "records", ["updated_at"], unique=False
      )
      # ### end Alembic commands ###
  
  
  def downgrade() -> None:
      # ### commands auto generated by Alembic - please adjust! ###
      op.drop_index(op.f("ix_records_updated_at"), table_name="records")
      op.drop_index(op.f("ix_records_time_ms"), table_name="records")
      op.drop_index(op.f("ix_records_status"), table_name="records")
      op.drop_index(op.f("ix_records_score"), table_name="records")
      op.drop_index(op.f("ix_records_memory_kb"), table_name="records")
      op.drop_index(op.f("ix_records_id"), table_name="records")
      op.drop_index(op.f("ix_records_created_at"), table_name="records")
      op.drop_index(op.f("ix_records_commit_id"), table_name="records")
      op.drop_table("records")
      # ### end Alembic commands ###
  