Skip to content

Commit 3050db5

Browse files
Maffoochclaude
andcommitted
chore(migrations): renumber vuln-id migrations after rebase onto dev
dev added 0285_cicd_infrastructure, which collided with the vuln-id 0285. Renumber the three vuln-id migrations to chain linearly after it: 0285_vulnerability_id_entity_tables -> 0286 (dep: 0285_cicd_infrastructure) 0286_backfill_vulnerability_id_entities -> 0287 0287_delete_vulnerability_id -> 0288 makemigrations --check clean; single leaf (0288). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 568154e commit 3050db5

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

dojo/db_migrations/0285_vulnerability_id_entity_tables.py renamed to dojo/db_migrations/0286_vulnerability_id_entity_tables.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Vulnerability ID entity tables: the normalized Vulnerability registry and the ordered
22
# Finding -> Vulnerability reference table. Both tables are CREATED EMPTY here, so every index
33
# (including the two GIN indexes) is built on zero rows — the DDL is effectively instant and needs
4-
# no AddIndexConcurrently. The data backfill runs separately in 0286 (atomic=False, resumable).
4+
# no AddIndexConcurrently. The data backfill runs separately in 0287 (atomic=False, resumable).
55
#
6-
# >50M-row fallback (documented, NOT the default path): on installs where the subsequent 0286
6+
# >50M-row fallback (documented, NOT the default path): on installs where the subsequent 0287
77
# backfill would insert tens of millions of reference rows, GIN maintenance during the backfill
88
# dominates. Such installs can strip the two GinIndex entries from the Vulnerability Meta here,
9-
# let 0286 populate the tables, then add both GIN indexes with CREATE INDEX CONCURRENTLY in a
9+
# let 0287 populate the tables, then add both GIN indexes with CREATE INDEX CONCURRENTLY in a
1010
# follow-up migration. Not needed for typical installs.
1111

1212
import django.contrib.postgres.indexes
@@ -20,7 +20,7 @@
2020
class Migration(migrations.Migration):
2121

2222
dependencies = [
23-
("dojo", "0284_backfill_finding_cwe"),
23+
("dojo", "0285_cicd_infrastructure"),
2424
]
2525

2626
operations = [

dojo/db_migrations/0286_backfill_vulnerability_id_entities.py renamed to dojo/db_migrations/0287_backfill_vulnerability_id_entities.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Data-only backfill of the Vulnerability entity + FindingVulnerabilityReference tables created
2-
# in 0285. atomic=False so each set-based statement (and each finding_id window in the reference
2+
# in 0286. atomic=False so each set-based statement (and each finding_id window in the reference
33
# build) commits on its own — a crash mid-backfill resumes where it left off, and ON CONFLICT DO
44
# NOTHING everywhere makes any re-run a no-op on completed work. Insert-only into the two NEW
55
# tables: dojo_vulnerability_id and dojo_finding are never rewritten, locked, or deleted, so
@@ -23,7 +23,7 @@ def backfill_vulnerability_id_entities(apps, schema_editor):
2323
connection.vendor,
2424
)
2525
return
26-
from dojo.vulnerability.backfill import run_backfill # noqa: PLC0415 -- keep entity import lazy/out of migration graph build
26+
from dojo.vulnerability.backfill import run_backfill # noqa: PLC0415 -- lazy import
2727

2828
run_backfill(logger=logger)
2929

@@ -35,7 +35,7 @@ class Migration(migrations.Migration):
3535
atomic = False
3636

3737
dependencies = [
38-
("dojo", "0285_vulnerability_id_entity_tables"),
38+
("dojo", "0286_vulnerability_id_entity_tables"),
3939
]
4040

4141
operations = [

dojo/db_migrations/0287_delete_vulnerability_id.py renamed to dojo/db_migrations/0288_delete_vulnerability_id.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Entity-only cutover: drop the legacy Vulnerability_Id store. Vulnerability ids now live entirely in
2-
# the Vulnerability entity + FindingVulnerabilityReference through-table (created in 0285, backfilled
3-
# from dojo_vulnerability_id in 0286 — which runs BEFORE this drop). ⚠️ DESTRUCTIVE: drops
4-
# dojo_vulnerability_id and its data. On upgrading installs, ensure 0286's backfill (or
2+
# the Vulnerability entity + FindingVulnerabilityReference through-table (created in 0286, backfilled
3+
# from dojo_vulnerability_id in 0287 — which runs BEFORE this drop). ⚠️ DESTRUCTIVE: drops
4+
# dojo_vulnerability_id and its data. On upgrading installs, ensure 0287's backfill (or
55
# `manage.py migrate_vulnerability_ids` pre-run) has completed before this migration removes the source.
66

77
from django.db import migrations
@@ -10,7 +10,7 @@
1010
class Migration(migrations.Migration):
1111

1212
dependencies = [
13-
("dojo", "0286_backfill_vulnerability_id_entities"),
13+
("dojo", "0287_backfill_vulnerability_id_entities"),
1414
]
1515

1616
operations = [

0 commit comments

Comments
 (0)