Summary
Add three nullable columns to variants to hold the independently-minted pre-mapped VRS value. This issue is schema-only — no minting logic, wiring, or backfill.
Proposed behavior
- New Alembic revision, chained onto the current release-2026.3.0 head, adding to
variants:
pre_mapped_vrs — JSONB, nullable.
pre_mapped_vrs_digest — String, nullable, indexed.
pre_mapped_vrs_version — String, nullable.
- No
server_default on any of the three. Every existing row starts null; backfilling them is separate work.
- Update the
Variant ORM model with matching Column declarations, placed alongside the existing hgvs_nt/hgvs_pro/hgvs_splice fields.
Acceptance criteria
- The migration applies cleanly on top of the current release-2026.3.0 head and downgrades cleanly, dropping all three columns.
variants.pre_mapped_vrs_digest has a btree index.
- The
Variant ORM model exposes pre_mapped_vrs, pre_mapped_vrs_digest, and pre_mapped_vrs_version, all nullable, defaulting to None.
- No existing row's data changes; no other table is read or written.
- A model-level test creates a
Variant, sets all three new fields, commits, re-fetches by id, and asserts each value round-trips exactly, including the full JSONB structure of pre_mapped_vrs.
Implementation notes
- Model the migration file on the existing
additional_mapping_columns revision, which adds columns to mapped_variants and target_genes the same way.
- Index
pre_mapped_vrs_digest as a plain indexed string column, the same way clingen_allele_id is indexed on MappedVariant (Column(String, index=True, nullable=True)) — not as a JSONB expression index like mapped_variants' existing index on pre_mapped->>'id'. This column is meant to be queried and joined on directly.
Summary
Add three nullable columns to
variantsto hold the independently-minted pre-mapped VRS value. This issue is schema-only — no minting logic, wiring, or backfill.Proposed behavior
variants:pre_mapped_vrs—JSONB, nullable.pre_mapped_vrs_digest—String, nullable, indexed.pre_mapped_vrs_version—String, nullable.server_defaulton any of the three. Every existing row starts null; backfilling them is separate work.VariantORM model with matchingColumndeclarations, placed alongside the existinghgvs_nt/hgvs_pro/hgvs_splicefields.Acceptance criteria
variants.pre_mapped_vrs_digesthas a btree index.VariantORM model exposespre_mapped_vrs,pre_mapped_vrs_digest, andpre_mapped_vrs_version, all nullable, defaulting toNone.Variant, sets all three new fields, commits, re-fetches by id, and asserts each value round-trips exactly, including the full JSONB structure ofpre_mapped_vrs.Implementation notes
additional_mapping_columnsrevision, which adds columns tomapped_variantsandtarget_genesthe same way.pre_mapped_vrs_digestas a plain indexed string column, the same wayclingen_allele_idis indexed onMappedVariant(Column(String, index=True, nullable=True)) — not as a JSONB expression index likemapped_variants' existing index onpre_mapped->>'id'. This column is meant to be queried and joined on directly.