"""Add chat retention settings to accounts.

Revision ID: 045
Revises: 044
Create Date: 2026-03-04
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

revision: str = "045"
down_revision: str = "044"
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
    op.add_column(
        "accounts",
        sa.Column("chat_retention_days", sa.Integer(), nullable=True, server_default=sa.text("90")),
    )
    op.add_column(
        "accounts",
        sa.Column("chat_retention_max_count", sa.Integer(), nullable=True, server_default=sa.text("100")),
    )


def downgrade() -> None:
    op.drop_column("accounts", "chat_retention_max_count")
    op.drop_column("accounts", "chat_retention_days")
