github.com/quay/claircore@v1.5.28/datastore/postgres/migrations/indexer/06-file-artifacts.sql (about) 1 -- file 2 CREATE TABLE IF NOT EXISTS file ( 3 id BIGSERIAL PRIMARY KEY, 4 path text NOT NULL, 5 kind text NOT NULL 6 ); 7 CREATE UNIQUE INDEX IF NOT EXISTS file_unique_idx ON file (path, kind); 8 9 -- FileScanArtifact 10 -- A relation linking discovered file to a layer 11 CREATE TABLE IF NOT EXISTS file_scanartifact ( 12 file_id bigint REFERENCES file(id) ON DELETE CASCADE, 13 scanner_id bigint REFERENCES scanner(id) ON DELETE CASCADE, 14 layer_id bigint REFERENCES layer(id) ON DELETE CASCADE, 15 PRIMARY KEY(layer_id, scanner_id, file_id) 16 ); 17 18 ALTER TABLE package_scanartifact ADD COLUMN filepath text;