feat(score_token): add room_id to score token table

This commit is contained in:
MingxuanGame
2025-12-20 19:42:14 +08:00
parent a24302c2df
commit f628061971
4 changed files with 54 additions and 29 deletions

View File

@@ -0,0 +1,34 @@
"""score_token: add room_id
Revision ID: 96c4f4b3f0ab
Revises: d430db6fc051
Create Date: 2025-12-20 11:39:02.640676
"""
from collections.abc import Sequence
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision: str = "96c4f4b3f0ab"
down_revision: str | Sequence[str] | None = "d430db6fc051"
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.add_column("score_tokens", sa.Column("room_id", sa.Integer(), nullable=True))
op.create_index("idx_playlist_room", "score_tokens", ["playlist_item_id", "room_id"], unique=False)
# ### end Alembic commands ###
def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index("idx_playlist_room", table_name="score_tokens")
op.drop_column("score_tokens", "room_id")
# ### end Alembic commands ###