-- Migration 048: Clinical notification settings
-- Adds columns to notification_settings for clinical alert thresholds

ALTER TABLE notification_settings
  ADD COLUMN IF NOT EXISTS clinical_appt_tomorrow  TINYINT(1) UNSIGNED NOT NULL DEFAULT 1
      COMMENT 'Notify about scheduled appointments for tomorrow (1=enabled)',
  ADD COLUMN IF NOT EXISTS clinical_med_end_days   TINYINT UNSIGNED    NOT NULL DEFAULT 7
      COMMENT 'Warn when active medication end_date is within N days',
  ADD COLUMN IF NOT EXISTS clinical_study_hours    SMALLINT UNSIGNED   NOT NULL DEFAULT 24
      COMMENT 'Warn when completed study not delivered after N hours',
  ADD COLUMN IF NOT EXISTS clinical_ars_days       TINYINT UNSIGNED    NOT NULL DEFAULT 7
      COMMENT 'Warn when ARS authorization expires within N days';
