fix(beatmap): make max_combo nullable

This commit is contained in:
MingxuanGame
2025-08-13 15:39:24 +00:00
parent e180dcfbd6
commit 3f5b242c6f
2 changed files with 39 additions and 1 deletions

View File

@@ -36,7 +36,7 @@ class BeatmapBase(SQLModel):
# optional
checksum: str = Field(sa_column=Column(VARCHAR(32), index=True))
current_user_playcount: int = Field(default=0)
max_combo: int = Field(default=0)
max_combo: int | None = Field(default=0)
# TODO: failtimes, owners
# BeatmapExtended

View File

@@ -0,0 +1,38 @@
"""beatmap: make max_combo nullable
Revision ID: ce29ef0a5674
Revises: 9aa4f7c06824
Create Date: 2025-08-13 15:38:59.797780
"""
from __future__ import annotations
from collections.abc import Sequence
from alembic import op
from sqlalchemy.dialects import mysql
# revision identifiers, used by Alembic.
revision: str = "ce29ef0a5674"
down_revision: str | Sequence[str] | None = "9aa4f7c06824"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None
def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column(
"beatmaps", "max_combo", existing_type=mysql.INTEGER(), nullable=True
)
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column(
"beatmaps", "max_combo", existing_type=mysql.INTEGER(), nullable=False
)
# ### end Alembic commands ###