Files
leocrm/alembic/versions/0024_heartbeat_config.py
T

25 lines
927 B
Python

"""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.execute("ALTER TABLE ai_proactive_settings ADD COLUMN IF NOT EXISTS heartbeat_enabled BOOLEAN NOT NULL DEFAULT true")
op.execute("ALTER TABLE ai_proactive_settings ADD COLUMN IF NOT EXISTS heartbeat_interval_seconds INTEGER NOT NULL DEFAULT 300")
op.execute("ALTER TABLE ai_proactive_settings ADD COLUMN IF NOT EXISTS heartbeat_target_room VARCHAR(200) NOT NULL 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")