internal/store/migrations/0083_security_dismissals.up.sql

main
gitbay/internal/store/migrations/0083_security_dismissals.up.sql

16 lines · 786 bytes

 1-- A finding a repository dismissed, by fingerprint, so it stays dismissed
 2-- across scans and line moves. Kept while scanning is off: turning it back
 3-- on does not bring back what was decided. by_id is NULL once that
 4-- account is gone.
 5CREATE TABLE security_dismissals (
 6    repo_id     INTEGER NOT NULL REFERENCES repos(id) ON DELETE CASCADE,
 7    fingerprint TEXT NOT NULL,
 8    reason      TEXT NOT NULL,
 9    by_id       INTEGER REFERENCES users(id) ON DELETE SET NULL,
10    created_at  TEXT NOT NULL DEFAULT (strftime('%Y-%m-%dT%H:%M:%fZ','now')),
11    PRIMARY KEY (repo_id, fingerprint)
12);
13
14-- What the last scan set aside rather than reported (codescan.Aside, as
15-- JSON), so a change in it rewrites the issue.
16ALTER TABLE security_scans ADD COLUMN aside TEXT NOT NULL DEFAULT '';