github.com/quay/claircore@v1.5.28/datastore/postgres/migrations/matcher/04-enrichments.sql (about)

     1  ALTER TABLE update_operation
     2      ADD COLUMN kind text;
     3  CREATE INDEX on update_operation (kind);
     4  
     5  UPDATE update_operation
     6  SET kind = 'vulnerability';
     7  
     8  CREATE TABLE enrichment
     9  (
    10      id        BIGSERIAL PRIMARY KEY,
    11      hash_kind text,
    12      hash      bytea,
    13      updater   text,
    14      tags      text[],
    15      data      jsonb
    16  );
    17  CREATE UNIQUE INDEX ON enrichment (hash_kind, hash);
    18  -- use inverted index for tags index
    19  CREATE INDEX ON enrichment USING gin (tags);
    20  
    21  CREATE TABLE uo_enrich
    22  (
    23      uo          BIGINT REFERENCES update_operation (id),
    24      enrich      BIGINT REFERENCES enrichment (id),
    25      updater     text,
    26      fingerprint text,
    27      date        timestamptz,
    28      PRIMARY KEY (uo, enrich)
    29  );