-- Migration 126: Add event_type to sag_reminders
-- Dato: 13. februar 2026

ALTER TABLE sag_reminders
    ADD COLUMN IF NOT EXISTS event_type VARCHAR(30) NOT NULL DEFAULT 'reminder'
    CHECK (event_type IN ('reminder', 'meeting', 'technician_visit', 'obs', 'deadline'));

CREATE INDEX IF NOT EXISTS idx_sag_reminders_event_type
    ON sag_reminders(event_type)
    WHERE deleted_at IS NULL;
