"""first revision

迁移 ID: 82115b280b5c
父迁移:
创建时间: 2025-10-23 11:48:37.362789

"""

from __future__ import annotations

from collections.abc import Sequence

import sqlalchemy as sa
from alembic import op

revision: str = "82115b280b5c"
down_revision: str | Sequence[str] | None = None
branch_labels: str | Sequence[str] | None = ("nonebot_plugin_rikka",)
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_userbindinfo",
        sa.Column("user_id", sa.String(), nullable=False),
        sa.Column("friend_code", sa.String(), nullable=True),
        sa.Column("lxns_api_key", sa.String(), nullable=True),
        sa.PrimaryKeyConstraint("user_id", name=op.f("pk_nonebot_plugin_rikka_userbindinfo")),
        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_userbindinfo")
    # ### end Alembic commands ###
