"""first revision

迁移 ID: 8141d1806585
父迁移:
创建时间: 2025-06-05 09:28:35.691503

"""

from __future__ import annotations

from collections.abc import Sequence

import sqlalchemy as sa
from alembic import op

revision: str = "8141d1806585"
down_revision: str | Sequence[str] | None = None
branch_labels: str | Sequence[str] | None = ("muicebot",)
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(
        "muicebot_msg",
        sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
        sa.Column("time", sa.String(), nullable=False),
        sa.Column("userid", sa.String(), nullable=False),
        sa.Column("groupid", sa.String(), nullable=True, default="-1"),
        sa.Column("message", sa.Text(), nullable=False),
        sa.Column("respond", sa.Text(), nullable=False),
        sa.Column("history", sa.Integer(), nullable=True, default=1),
        sa.Column("resources", sa.Text(), nullable=True, default="[]"),
        sa.Column("usage", sa.Integer(), nullable=True, server_default=sa.text("-1")),
        sa.PrimaryKeyConstraint("id", name=op.f("pk_muicebot_msg")),
        info={"bind_key": "muicebot"},
    )
    # ### end Alembic commands ###


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