"""add message_record table

Revision ID: 6d101e418d9b
Revises: 37856833b9a2
Create Date: 2025-11-26 18:07:19.065393

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '6d101e418d9b'
down_revision: Union[str, Sequence[str], None] = '37856833b9a2'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    """Upgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('message_record',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('message_id', sa.String(length=64), nullable=False),
    sa.Column('sender_id', sa.String(length=64), nullable=False),
    sa.Column('sender_name', sa.String(length=128), nullable=False),
    sa.Column('send_time', sa.DateTime(), nullable=False),
    sa.Column('group_id', sa.String(length=64), nullable=True),
    sa.Column('group_name', sa.String(length=128), nullable=True),
    sa.Column('content', sa.String(length=2048), nullable=False),
    sa.Column('at_target_list', sa.String(length=512), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('message_record')
    # ### end Alembic commands ###
