"""add play count

迁移 ID: dc59349a578a
父迁移: 5c791c303fe1
创建时间: 2026-01-24 09:19:05.905902

"""

from __future__ import annotations

from collections.abc import Sequence

import sqlalchemy as sa
from alembic import op

revision: str = "dc59349a578a"
down_revision: str | Sequence[str] | None = "5c791c303fe1"
branch_labels: str | Sequence[str] | None = None
depends_on: str | Sequence[str] | None = None


def upgrade(name: str = "") -> None:
    if name:
        return
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "nonebot_plugin_rikka_playcount",
        sa.Column("user_id", sa.String(), nullable=False),
        sa.Column("song_id", sa.Integer(), nullable=False),
        sa.Column("difficulty", sa.Integer(), nullable=False),
        sa.Column("play_count", sa.Integer(), nullable=False),
        sa.PrimaryKeyConstraint(
            "user_id",
            "song_id",
            "difficulty",
            name=op.f("pk_nonebot_plugin_rikka_playcount"),
        ),
        info={"bind_key": "nonebot_plugin_rikka"},
    )
    # ### end Alembic commands ###


def downgrade(name: str = "") -> None:
    if name:
        return
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table("nonebot_plugin_rikka_playcount")
    # ### end Alembic commands ###
