"""add TOTP fields to users

Revision ID: 0015_totp
Revises: 0014_remove_projects
Create Date: 2026-03-28
"""
from alembic import op
import sqlalchemy as sa

revision = "0015_totp"
down_revision = "0014_remove_projects"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.add_column("users", sa.Column("totp_secret", sa.String(64), nullable=True))
    op.add_column("users", sa.Column("totp_enabled", sa.Boolean(), nullable=False, server_default="false"))


def downgrade() -> None:
    op.drop_column("users", "totp_enabled")
    op.drop_column("users", "totp_secret")
