"""reset voice_tts_voice and voice_tts_blend settings for piper migration

Revision ID: 0047
Revises: 0046
Create Date: 2026-05-22

The TTS backend swapped from kokoro to piper. Kokoro voice IDs
(`af_heart`, `am_adam`, etc.) don't map to piper voice files
(`en_US-amy-medium`, etc.) and there's no sensible auto-translation.
Clear the stored voice selection so every user falls back to the piper
default the next time they synthesize.

`voice_tts_blend` goes away entirely — piper has no voice-blending
equivalent. The TTS service accepts the field for backward compat but
ignores it; clearing the rows makes the DB match reality.

Both settings re-default cleanly on read, so this migration just deletes
the rows without backfilling anything.
"""
from alembic import op


revision = "0047"
down_revision = "0046"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.execute(
        "DELETE FROM settings WHERE key IN ('voice_tts_voice', 'voice_tts_blend')"
    )


def downgrade() -> None:
    # No-op. The deleted settings just re-default on read; restoring the
    # kokoro IDs wouldn't help anyway since kokoro is gone.
    pass
