"""first revision

迁移 ID: 0ef2cf7a5041
父迁移: 
创建时间: 2025-07-21 16:43:22.667289

"""
from __future__ import annotations

from collections.abc import Sequence

from alembic import op
import sqlalchemy as sa


revision: str = '0ef2cf7a5041'
down_revision: str | Sequence[str] | None = None
branch_labels: str | Sequence[str] | None = ('nonebot_plugin_delta_helper',)
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_delta_helper_latestrecord',
    sa.Column('qq_id', sa.Integer(), nullable=False),
    sa.Column('latest_record_id', sa.String(), nullable=False),
    sa.PrimaryKeyConstraint('qq_id', name=op.f('pk_nonebot_plugin_delta_helper_latestrecord')),
    info={'bind_key': 'nonebot_plugin_delta_helper'}
    )
    op.create_table('nonebot_plugin_delta_helper_userdata',
    sa.Column('qq_id', sa.Integer(), nullable=False),
    sa.Column('group_id', sa.Integer(), nullable=False),
    sa.Column('access_token', sa.String(), nullable=False),
    sa.Column('openid', sa.String(), nullable=False),
    sa.PrimaryKeyConstraint('qq_id', name=op.f('pk_nonebot_plugin_delta_helper_userdata')),
    info={'bind_key': 'nonebot_plugin_delta_helper'}
    )
    # ### end Alembic commands ###


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