-- SysOps activiteitenlog — verslagen voor IT Ops UI en Herman briefing

CREATE TABLE IF NOT EXISTS sysops_activity (
    id SERIAL PRIMARY KEY,
    action_type VARCHAR(64) NOT NULL,
    title VARCHAR(255) NOT NULL,
    body TEXT,
    commit_ref VARCHAR(128),
    files_changed INTEGER DEFAULT 0,
    status VARCHAR(32) DEFAULT 'success',
    source VARCHAR(64) DEFAULT 'sysops',
    metadata JSONB DEFAULT '{}'::jsonb,
    created_at TIMESTAMPTZ DEFAULT NOW()
);
CREATE INDEX IF NOT EXISTS idx_sysops_activity_created ON sysops_activity(created_at DESC);
CREATE INDEX IF NOT EXISTS idx_sysops_activity_type ON sysops_activity(action_type, created_at DESC);
