"""Add message_count and last_message_at to conversations

Revision ID: 8da391c6e2b7
Revises: 424646027786
Create Date: 2025-12-19 16:16:29.943314

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = '8da391c6e2b7'
down_revision: Union[str, Sequence[str], None] = '424646027786'
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.add_column('conversations', sa.Column('message_count', sa.Integer(), nullable=False))
    op.add_column('conversations', sa.Column('last_message_at', sa.DateTime(), nullable=True))
    # ### end Alembic commands ###


def downgrade() -> None:
    """Downgrade schema."""
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('conversations', 'last_message_at')
    op.drop_column('conversations', 'message_count')
    # ### end Alembic commands ###
