"""insights

迁移 ID: 25b14ed0ad3c
父迁移: ec1f1e46989b
创建时间: 2025-08-17 16:41:02.274825

"""

from __future__ import annotations

from collections.abc import Sequence

import sqlalchemy as sa
from alembic import op

revision: str = "25b14ed0ad3c"
down_revision: str | Sequence[str] | None = "ec1f1e46989b"
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(
        "suggarchat_global_insights",
        sa.Column("date", sa.String(64), nullable=False),
        sa.Column(
            "token_input", sa.BigInteger(), server_default=sa.text("0"), nullable=False
        ),
        sa.Column(
            "token_output", sa.BigInteger(), server_default=sa.text("0"), nullable=False
        ),
        sa.Column("usage_count", sa.Integer(), nullable=False),
        sa.PrimaryKeyConstraint("date", name=op.f("pk_suggarchat_global_insights")),
        info={"bind_key": "nonebot_plugin_suggarchat"},
    )
    # ### end Alembic commands ###


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