fix(daily-challenge): fix duplicated top 10%/50% placements

This commit is contained in:
MingxuanGame
2025-08-22 13:38:52 +00:00
parent 32df7a4ce8
commit 2ac56ed3bf
3 changed files with 56 additions and 5 deletions

View File

@@ -0,0 +1,47 @@
"""daily_challenge: add last_day_streak
Revision ID: 178873984b22
Revises: 5b76689f6e4b
Create Date: 2025-08-22 13:34:31.282236
"""
from __future__ import annotations
from collections.abc import Sequence
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = "178873984b22"
down_revision: str | Sequence[str] | None = "5b76689f6e4b"
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(
"daily_challenge_stats",
"last_update",
new_column_name="last_day_streak",
existing_type=sa.DateTime(),
nullable=True,
)
op.add_column("daily_challenge_stats", sa.Column("last_update", sa.DateTime(), nullable=True))
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column(
"daily_challenge_stats",
"last_update",
existing_type=sa.DateTime(),
nullable=True,
)
op.alter_column("daily_challenge_stats", "last_day_streak", new_column_name="last_update")
# ### end Alembic commands ###