Commit df89604
committed
refactor: fold osv-sync migrations into V1779710880 initial schema
Per Joana's preference (and consistent with how PRs #4148 and #4150
absorbed previous schema deltas), edit the consolidated initial
migration in place rather than layering separate ones while
packages-db is still pre-production.
Folded into V1779710880:
- packages.has_critical_vulnerability — boolean NOT NULL DEFAULT
FALSE + partial index on TRUE. Replaces the deferred "column
commented out" stub. Inline comment cites the option-b + MAL-
semantics decision in ADR-0001 §`has_critical_vulnerability`
semantics.
- advisories.cvss_source — text, nullable, four documented values
('osv_cvss_v3', 'osv_cvss_v4', 'osv_qualitative_fallback',
'osv_malicious_package'). Inline comment cites ADR-0001 §CVSS
scoring strategy and lists the values for downstream consumers.
- advisory_affected_ranges unique index — widened from
(advisory_package_id, COALESCE(introduced_version, '')) to the
full tuple including COALESCE(fixed_version, '') and
COALESCE(last_affected, ''). Inline comment cites ADR-0001
§`advisory_affected_ranges` uniqueness scope.
Deleted (now folded):
- V1779871303__add_cvss_source_to_advisories.sql
- V1779871327__add_has_critical_vulnerability_to_packages.sql
- V1779897650__widen_advisory_affected_ranges_unique_index.sql
- V1779951727__align_advisory_ecosystem_lowercase.sql
The lowercase ecosystem migration goes away entirely: the table is
empty in prod, parseOsvRecord lowercases at the OSV boundary, and
the application is the source of truth for the casing convention.
No backfill needed.
Local cost: one `flyway repair` (or volume drop + reapply) for any
teammate with the branch checked out, since the V1779710880
checksum changes. Same pattern the team used twice this week.
Verified locally: dropped the packages-db volume, ran Flyway from
scratch, all expected columns and indexes present. The 70 unit
tests still pass.
Signed-off-by: Joan Reyero <joan@reyero.io>1 parent de1fce6 commit df89604
5 files changed
Lines changed: 33 additions & 83 deletions
Lines changed: 33 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
82 | 84 | | |
83 | 85 | | |
84 | 86 | | |
85 | | - | |
86 | | - | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
87 | 93 | | |
88 | 94 | | |
89 | 95 | | |
| |||
569 | 575 | | |
570 | 576 | | |
571 | 577 | | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
572 | 587 | | |
573 | 588 | | |
574 | 589 | | |
| |||
613 | 628 | | |
614 | 629 | | |
615 | 630 | | |
616 | | - | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
617 | 643 | | |
618 | 644 | | |
619 | 645 | | |
| |||
Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 0 additions & 37 deletions
This file was deleted.
Lines changed: 0 additions & 16 deletions
This file was deleted.
0 commit comments