-- Migration 144: Sag beskrivelse (description) change history
-- Dato: 2026

CREATE TABLE IF NOT EXISTS sag_beskrivelse_history (
    id SERIAL PRIMARY KEY,
    sag_id INTEGER NOT NULL,
    beskrivelse_before TEXT,
    beskrivelse_after TEXT,
    changed_by_user_id INTEGER,
    changed_by_name VARCHAR(255),
    changed_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);

CREATE INDEX IF NOT EXISTS idx_sbh_sag_id ON sag_beskrivelse_history(sag_id);
CREATE INDEX IF NOT EXISTS idx_sbh_changed_at ON sag_beskrivelse_history(changed_at);
