"""Heartbeat configuration — add heartbeat fields to ai_proactive_settings.

Revision ID: 0024
Revises: 0023_theme_customization
Create Date: 2026-07-23
"""
from alembic import op
import sqlalchemy as sa


revision = "0024_heartbeat_config"
down_revision = "0023_theme_customization"


def upgrade():
    op.add_column("ai_proactive_settings", sa.Column("heartbeat_enabled", sa.Boolean(), nullable=False, server_default=sa.text("true")))
    op.add_column("ai_proactive_settings", sa.Column("heartbeat_interval_seconds", sa.Integer(), nullable=False, server_default=sa.text("300")))
    op.add_column("ai_proactive_settings", sa.Column("heartbeat_target_room", sa.String(200), nullable=False, server_default="Live KI"))


def downgrade():
    op.drop_column("ai_proactive_settings", "heartbeat_target_room")
    op.drop_column("ai_proactive_settings", "heartbeat_interval_seconds")
    op.drop_column("ai_proactive_settings", "heartbeat_enabled")
