CREATE TABLE vulnerability_scores (
    id BIGINT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
    vulnerability_id BIGINT NOT NULL REFERENCES vulnerabilities (id) ON DELETE CASCADE,
    source TEXT NOT NULL,
    scheme TEXT NOT NULL,
    score REAL,
    severity TEXT,
    vector TEXT,
    metadata JSONB NOT NULL DEFAULT '{}'::jsonb,
    created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
    UNIQUE (vulnerability_id, source, scheme)
);
