This commit is contained in:
XuChenXu 2025-04-20 08:53:33 +08:00
commit a7bdd6033e

View File

@ -0,0 +1,61 @@
"""empty message
迁移 ID: 873ad3421460
父迁移:
创建时间: 2025-03-29 14:30:11.910461
"""
from __future__ import annotations
from collections.abc import Sequence
import sqlalchemy as sa
from alembic import op
revision: str = "873ad3421460"
down_revision: str | Sequence[str] | None = None
branch_labels: str | Sequence[str] | None = ("nonebot_plugin_dialectlist",)
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_dialectlist_messagecountcache",
sa.Column("id", sa.Integer(), autoincrement=True, nullable=False),
sa.Column("time", sa.DateTime(), nullable=False),
sa.Column("session_id", sa.Integer(), nullable=False),
sa.Column("session_bnum", sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint(
"id", name=op.f("pk_nonebot_plugin_dialectlist_messagecountcache")
),
info={"bind_key": "nonebot_plugin_dialectlist"},
)
with op.batch_alter_table(
"nonebot_plugin_dialectlist_messagecountcache", schema=None
) as batch_op:
batch_op.create_index(
batch_op.f("ix_nonebot_plugin_dialectlist_messagecountcache_session_id"),
["session_id"],
unique=False,
)
# ### end Alembic commands ###
def downgrade(name: str = "") -> None:
if name:
return
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table(
"nonebot_plugin_dialectlist_messagecountcache", schema=None
) as batch_op:
batch_op.drop_index(
batch_op.f("ix_nonebot_plugin_dialectlist_messagecountcache_session_id")
)
op.drop_table("nonebot_plugin_dialectlist_messagecountcache")
# ### end Alembic commands ###