Skip to content

Commit c85d9c0

Browse files
ulemonsskwowet
authored andcommitted
feat: add sonatype fields (CM-1308) (#4298)
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org> Signed-off-by: Yeganathan S <63534555+skwowet@users.noreply.github.com>
1 parent 937eb98 commit c85d9c0

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
-- Sonatype popularity signal (first delivery: Maven P0, top 500 components).
2+
-- Sonatype could not provide raw Maven download counts, so instead they deliver a
3+
-- popularity score derived from their SCA telemetry: normalized 0-100 per ecosystem,
4+
-- tiered P0-P3. Stored in dedicated columns (not JSONB) because score/rank/tier are
5+
-- queried independently. Only sonatype_popularity_score feeds rank_packages(); rank and
6+
-- tier are kept for display/audit. No index on first pass (dataset is small, 500-2k rows).
7+
ALTER TABLE packages
8+
ADD COLUMN IF NOT EXISTS sonatype_popularity_score numeric, -- 0-100, normalized per ecosystem; consumed by rank_packages()
9+
ADD COLUMN IF NOT EXISTS sonatype_rank int, -- rank within the Sonatype list; display/audit only
10+
ADD COLUMN IF NOT EXISTS sonatype_tier text, -- 'P0' | 'P1' | 'P2' | 'P3'
11+
ADD COLUMN IF NOT EXISTS sonatype_snapshot_at timestamptz, -- timestamp of the Sonatype snapshot the row came from
12+
ADD COLUMN IF NOT EXISTS sonatype_updated_at timestamptz; -- our last upsert of the sonatype_* fields

0 commit comments

Comments
 (0)