canopy-snap Data Model

For a contributor or maintainer reading the SNAP schema: the tables below are the schema in effect after the migrations listed at the end, applied in order. Only the constraints named CHECK, UNIQUE or EXCLUDE are enforced by the database; the other value sets quoted (status, claim_basis, …) are the service’s or the canopy-overpayments crate’s own vocabulary. Endpoint detail is on the canopy-snap API page; the shared event_outbox / event_inbox pair is described once on the data-models index. Source: migrations/.

Tables

Table Purpose

snap_applications

One row per application received from canopy-eligibility: the orchestrator’s application_id, household_id, the full application_context JSONB and a coarse status (default received).

snap_determinations

One signed determination per application evaluation: application_id (FK → snap_applications), household_id, status (CHECK snap_determinations_status_verdict: approved / denied / sanctioned / withheld, #628 — canopy-snap signs only approved and denied), benefit_amount + benefit_unit, the signed certification period counted in whole calendar months (canopy_common::expedited_postponement::certification_period, #2005): effective_date (the certification START — the first day of the anchor month), expiration_date (the inclusive last covered day — the month-end N − 1 months after the start’s month), renewal_date (the 7 CFR 273.14(c) filing deadline, canopy_types::recert::renewal_deadline — day [snap.certification].recert_timely_filing_day of the last month; under the expedited_postponed basis the verification deadline, equal to expiration_date), basis, denial_reason_codes TEXT[], the ADR-002 signature, program_service_version, determined_at. Added later: snapshot_hash TEXT NOT NULL (the ADR-028 input-snapshot hash bound into the signature); previous_determination_id (self-FK, the supersession chain — at most one successor per prior, idx_snap_determinations_previous_unique); trigger TEXT CHECK (trigger IN ('cola','fpl','ruleset-migration','change-report','renewal','worker-initiated','work-sanction')) (the last added by #3219); effective_date_basis JSONB, benefit_effective_date DATE (the proration anchor — the legal filing day or the arm’s action date; effective_date is the first of its month on every basis except in_cert_conversion, whose period keeps the filing month while the anchor is the conversion day), operation_id (unique where set, snap_determinations_operation_uq); program_extension JSONB (the envelope’s program extension, kept so the envelope re-verifies from storage); signed_payload BYTEA NOT NULL (#1984) — the exact RFC 8785 bytes the signature covers, computed once at signing, persisted in the determination’s transaction and served verbatim by GET /v1/determinations/{id}/envelope.

determination_snapshots

The immutable ADR-028 input snapshot, one per determination: determination_id (PK, FK → snap_determinations), snapshot JSONB, corpus_hash, as_of DATE, signing_kid, created_at. Trigger determination_snapshots_append_only rejects UPDATE / DELETE / TRUNCATE unless canopy.snapshot_maintenance = 'on'. PII leaves are ADR-036 SealedValue envelopes hashed over ciphertext. Detail: ADR-028.

redaction_keys

Per-determination DEK store for crypto-shred (ADR-036): dek_id (PK), wrapped_dek BYTEA, kek_version SMALLINT, subject_kind / subject_id (determination_snapshot / the determination id), created_at (the determination’s decision instant, bound by the store; no default since #2475), shredded_at (NULL = live; the redaction’s instant when set). Trigger canopy_redaction_keys_one_way_guard permits INSERT and exactly two live-row UPDATEs — the tombstone (wrapped_dek + shredded_at) and the KEK rewrap (wrapped_dek replaced + kek_version strictly increased, 20261224000000, #2113); uq_redaction_keys_live_subject keeps one live DEK per subject.

ievs_verification_data

Legacy IEVS outcomes (person_id, data_source, match_result JSONB, verified_at); predates ievs_match_results / ievs_discrepancies and is kept for backfill compatibility. No code reads or writes it since create_ievs_record and the IevsVerificationRecord wire shape were removed (#2179); the table stays for the applied migration.

snap_program_participations

Categorical-eligibility participation (7 CFR 273.2(j)): one row per (person, program, effective_date); program is the qualifying program (SSI, TANF cash, GA); verification_status; soft-delete via active; unique (person_id, program) WHERE active = true.

snap_student_status

Student-exclusion screening (7 CFR 273.5): enrollment_half_time_plus, institution_name + enrollment_verified, exception_type + exception_verified; soft-delete via active.

abawd_tracking

ABAWD time-limit state (7 CFR 273.24): the 36-month window_start_date / window_end_date, months_used, current_status (tracking, exhausted, regained since #3220, exempt; no CHECK), exemption_type / exemption_expires, waiver_area_code, discretionary_exemption_id; unique (person_id) WHERE active = true.

snap_work_registrations

A member’s work-registration standing and ABAWD screening as a worker records them (7 CFR 273.7, 273.24; #3218), append-only: standing (exempt, registrant, voluntary_registrant), exemption and abawd_exception (pack codes, unchecked by the table), exemption_expires, abawd_screening (not_abawd, abawd, aged_abawd), et_referred_on, effective_date, recorded_by, created_at. CHECKs: an exemption iff not a mandatory registrant; an abawd or aged_abawd screening only on a registrant; an exception only on not_abawd; an expiry only beside an exemption or exception. Unique (person_id, effective_date, created_at).

snap_work_sanctions

A member's work-sanction findings as a worker records them (7 CFR 273.7(f); #3219): work_registration_id (FK snap_work_registrations), violation (failure_to_comply, voluntary_quit, hours_reduction), violation_number (≥ 1, counted by canopy-snap), good_cause (not_established, established), minimum_months and begins_on (present iff no good cause: snap_work_sanctions_imposed_shape), effective_date, recorded_by, created_at, and the lift's lifted_on, lift_reason (complied, exempt, good_cause_found, hearing_reversed), ends_on, lifted_by, lifted_at, written together on an imposed row only, with ends_on never before begins_on (snap_work_sanctions_lift_shape). Indexed by (person_id, created_at) and household_id. Migration 20270321000000_snap_work_sanctions.sql; 20270321000001_snap_determinations_trigger_work_sanction.sql adds work-sanction to the snap_determinations.trigger CHECK.

abawd_monthly_activity

One row per (person, benefit_month) (unique): hours by category, snap_received, reported_by; FK abawd_tracking_id → abawd_tracking.

snap_abawd_regains

An exhausted ABAWD's regaining of eligibility as a worker records it (7 CFR 273.24(d)-(e); #3220): FK abawd_tracking_id → abawd_tracking, person_id, period_start / period_end (CHECK snap_abawd_regains_period_order), hours (≥ 0), months_allowed (≥ 0: the pack's second_period_months for the window's first regaining, 0 after), recorded_by, created_at. Never edited. Indexed by (abawd_tracking_id, period_end, created_at). Migration 20270322000001_snap_abawd_regains.sql.

snap_abawd_discretionary_exemptions

One exempted benefit month of one ABAWD (7 CFR 273.24(g); #3220): person_id, FK abawd_tracking_id → abawd_tracking, benefit_month (CHECK the first of a month), fiscal_year (CHECK the federal fiscal year of benefit_month), recorded_by, created_at. Never edited. Unique (person_id, benefit_month); indexed by fiscal_year (the allotment count) and abawd_tracking_id (the time-limit count). Migration 20270322000000_snap_abawd_discretionary_exemptions.sql.

abawd_waiver_areas

FNS-approved waiver areas (7 CFR 273.24(f)): area_code, area_name, waiver_start_date / waiver_end_date, fns_waiver_approval_number; soft-delete via active.

abawd_time_clock

The PAMMS 3355 time clock, one row per (person_id, period_start) (unique): month_statuses JSONB ({"YYYY-MM": "<status_code>"} over the fifteen PAMMS 3355 codes listed in the migration) and countable_months.

snap_disqualification_screenings

Special-situation screenings (7 CFR 273.11(e), (m), (n)): screening_type discriminates drug felony / fleeing felon / probation-parole / striker; self_attested + self_attested_date, conviction_date, pre_strike_income, screening_result (starts pending), screened_by (TEXT, the screening worker’s OIDC subject — human-only, no writer yet; #1008); soft-delete via active.

ievs_match_results

IEVS income matches, ONE current row per (application_id, person_id, match_source) (unique idx_unique_ievs_match): verified_monthly_income, verified_income_type, verified_frequency, match_status (starts pending). Since #2665 every verification run upserts the row (keeping its id, so its discrepancies stay attached) with the run’s figures and status. A source a COMPLETE answer (match_status completed) carried no record for has its earlier row cleared (verified_monthly_income NULL); a partial answer (canopy-verification’s partial: a source query failed upstream) leaves its unanswered sources' rows and discrepancies as they stood. Each member’s rows are written in one transaction. The state wage match computes two monthly figures from EVERY wage record IEVS returned for the member, each per month by the budgeting factors' months_per_quarter, with concurrent employers in a quarter adding (wage_figures in services/canopy-snap/src/verification.rs). One is the average: the records' total over the distinct quarters they report. The other is the latest quarter: the total of every employer’s record in the latest quarter reported (#2691). Both are compared with the member’s self-reported wages, and a discrepancy is flagged when EITHER differs by more than the unchanged $100 threshold. IEVS matching exists to surface earnings that differ from what was reported (7 CFR 272.8): the latest quarter catches a current change that offsetting quarters would average away (Q1 $9,000 and Q2 $3,000 average to $2,000 a month, while Q2 alone is $1,000), and the average keeps the #2665 comparison, so the second figure only adds flags. The wage row’s verified_monthly_income records the one figure further from the self-reported wages, the average on a tie (compared_figure): the figure that drove the flag, and the same figure the discrepancy carries. The row has one figure column and the match-result read returns it as it stands, so the other figure is not stored.

ievs_discrepancies

Self-reported vs IEVS-verified variance, per member: since #2678 self_reported_monthly_income is the member’s own reports of the compared kinds, never the household’s total (a row resolved or withdrawn before then keeps the figure it was flagged with); FK match_result_id → ievs_match_results; variance_monthly is a GENERATED ALWAYS … STORED column (verified_monthly_income - COALESCE(self_reported_monthly_income, 0)); resolution_status (starts pending); the optional actor pair resolved_by (the resolving worker’s OIDC subject, TEXT) / resolved_by_service (a system caller’s client id) — bearer-derived by verification_handler::resolve_discrepancy through principal.actor(), with ievs_discrepancies_resolved_by_one_actor (at most one) and ievs_discrepancies_resolved_by_iff_resolved (set exactly when resolved_at is; #1008 — the dead UUID resolved_by was dropped and resolved_by_sub renamed into its place); resolved_fact_id (the canopy-persons fact_id authored on accept; nullable, unconstrained per ADR-001). The verification run keeps at most one OPEN (unresolved) discrepancy per match row and income_type (#2665) — a rule the run applies under the match row’s lock (its upsert, in the same transaction), not an index: a re-run that finds a discrepancy refreshes the open row’s figures in place (same id) or flags a new row — unless a resolved row already carries exactly the run’s figures, which a worker has decided — and a complete re-run that finds none withdraws the open row by a status transition, never a delete: resolution_status becomes withdrawn and withdrawn_at (TIMESTAMPTZ, nullable) records when that run stored its answer (its match row’s match_completed_at), bound by ievs_discrepancies_withdrawn_iff_stamped (withdrawn exactly when stamped) and ievs_discrepancies_withdrawn_never_resolved. A withdrawn row is no longer open, so it never blocks a later flag, and it takes no resolution (the resolve answers 409 discrepancy_withdrawn); it stays so that a persons fact an accept already authored (origin ievs:{id}) still names an existing row. Resolved and withdrawn rows are never touched again.

citizenship_verifications

SAVE outcomes only (the raw query stays in canopy-verification, ADR-004): save_case_number, immigration_status_category, lawful_presence_verified, qualified_alien_category, five_year_bar_applies / five_year_bar_met_date (8 USC §1613), snap_eligible + snap_eligibility_basis.

snap_tsnap_certifications

Transitional SNAP windows on TANF exit (7 CFR 273.26): certification_start_date / certification_end_date, frozen_benefit_amount, pre_closure_snap_allotment, tanf_grant_removed, reporting_required, sanctions_applicable, tanf_closure_reason. id is app-supplied (default dropped in 20260804000000).

overpayment_claims

The canonical claim table shared by the three program services that stamp it (canopy-snap, canopy-tanf, canopy-medicaid) (crates/canopy-overpayments/migrations/canonical*.sql): person_id, household_id, determination_id (unconstrained — back-rebill flows may cite a cross-service determination), claim_amount_cents (the original principal; outstanding is computed from the ledger), claim_basis, error_type, discovered_at (a legal date: on a claim the service opens itself — from a subscriber or a recompute — the opening decision instant as a date in the pack’s [jurisdiction].timezone, #2241), the mandatory actor pair discovered_by (the filing human’s OIDC subject, TEXT — a worker’s bearer, or a recompute’s requester) / discovered_by_service (a system caller’s client id, or canopy-snap for its CB-assessment and IPV subscribers' claims) with overpayment_claims_discovered_by_one_actor (exactly one set; #1008), status (default open), closed_at; provenance appeal_id, adverse_action_id, assessment_id, source_event_id (partial UNIQUEs on the last two make a redelivered assessment a no-op); the void path voided_at, void_reason CHECK (void_reason IN ('veto','action_canceled','reallocation')). Vocabularies (ClaimBasis, ClaimStatus) are the crate’s. Since #3567 the row also carries period_first_month / period_last_month (#3567: the benefit months the claim covers, each a first of the month; overpayment_claims_period_whole_months holds the pair to both-or-neither, whole months, in order), and canopy-snap alone requires them (overpayment_claims_snap_period_required): a SNAP demand letter must state the claim’s period (7 CFR 273.18(e)(3)(iv)(D)).

repayment_plans

Repayment schedules per claim: FK overpayment_claim_id → overpayment_claims; monthly_amount_cents, starts_on / ends_on, status (PlanStatus).

recoupment_ledger

Append-only recoupment events: FK overpayment_claim_id → overpayment_claims, optional FK repayment_plan_id → repayment_plans; method (RecoupmentMethod; allotment_reduction is the 7 CFR 273.18 default), amount_cents. Outstanding = claim_amount_cents + SUM(claim_adjustments.delta_cents) - SUM(amount_cents), recomputed in Rust.

claim_adjustments

Append-only principal corrections: FK overpayment_claim_id → overpayment_claims; signed delta_cents, reason (AdjustmentReason), optional source_assessment_id / actor / notes, requires_ops_review. claim_amount_cents is never rewritten.

overpayment_recomputes

Audit + idempotency record of a recompute-from-snapshot (ADR-028 §70): baseline_determination_id, household_id, person_id, correction_as_of, baseline_benefit_cents / correct_benefit_cents, overpayment_cents (the claimed amount on claim_created, the declined amount on below_threshold, 0 otherwise), affected_months, covered_period_start / covered_period_end, outcome (CHECK-constrained since #2440 by overpayment_recomputes_outcome_recorded to the six outcomes a row records — claim_created, below_threshold, provisional_excluded, overlapping_claim, no_overpayment, underpayment_found; the service refuses any other token on read) + outcome_message (the reason on below_threshold), claim_basis (the request’s basis, on every row since #2243), claim_id, notice_id, corpus_hash_used, the mandatory actor pair requested_by (the actioning worker’s OIDC subject, TEXT) / requested_by_service (a system caller’s client id) with overpayment_recomputes_requested_by_one_actor (exactly one set; #1008); overpayment_recomputes_window_once, UNIQUE (baseline_determination_id, covered_period_start) since #2243 (the claim window’s first month, which every correction date in a month resolves to; it replaced UNIQUE (baseline_determination_id, correction_as_of)), makes a retry idempotent. #936 (20261226000000_overpayment_recompute_floor_audit.sql): discovered_in_qc_review (the request’s quality-control-origin attestation; NOT NULL since #2243) and sized_months (JSONB array, CHECK-constrained to an array, of {benefit_month, paid_cents, correct_cents, overpayment_cents} — the replayed window month by month on every outcome that sized; NULL for a guard outcome and on an earlier row), so a below_threshold row documents its months, amounts and reason. #2325 (20270114000000_overpayment_recompute_verdicts.sql): baseline_status (NOT NULL — the determination of record’s status) and correct_status (the corrected replay’s status), each CHECK-constrained to approved / denied / sanctioned / withheld; overpayment_recomputes_correct_status_iff_sized makes correct_status NULL exactly when sized_months is (a guard outcome never replays), so the re-return states each verdict as computed rather than rebuilding it from the cents. #2243 (20270114000001_overpayment_recompute_request_terms.sql): claim_basis and discovered_in_qc_review are NOT NULL — the request’s terms on every row (claim_basis is the worker’s requested basis: the claim’s on claim_created, the declined one on below_threshold), so a repeat of the natural key is told identical (replayed) or conflicting (409).

overpayment_claim_screens

The pre-establishment claim-floor screen of the claim paths beside the recompute (#2242, 20270114000002_overpayment_claim_screens.sql): source (manual | ipv_not_established | appeal_assessed), ipv_case_id (the IPV case an ADH claim reprocesses; set exactly for ipv_not_established), appeal_id / adverse_action_id / assessment_id / source_event_id (the #1104 assessment provenance of a dismissed or withdrawn appeal’s continued-benefits claim, as appeal.overpayment_assessed carried it; overpayment_claim_screens_provenance_only_appeal keeps them NULL on the other sources), the claim as it would be filed (household_id, person_id, determination_id, claim_basis, claim_amount_cents > 0, error_type, discovered_at), discovered_in_qc_review (the attestation; for an ADH claim, the IPV referral's, #2444; NULL when unrecorded — an ADH claim whose referral predates the attestation), the mandatory actor pair discovered_by / discovered_by_service, outcome (pending — an ADH or appeal claim staged for the claim-screen pass — claim_created with its claim_id, below_threshold, or voided — a pending appeal claim whose assessment canopy-appeals voided), the verdict floor_cents / participation (participating | not_participating) / establishment_date / outcome_message (the reason), attempts / last_error (failed participation reads while pending), created_at / decided_at. overpayment_claim_screens_outcome_shape pins each outcome to exactly the facts it decided; a declined row records the amount, the floor, the participation, the date and the reason, as a below_threshold recompute row does. Since #3567 every screen row carries period_first_month / period_last_month, NOT NULL and whole months in order (overpayment_claim_screens_period_whole_months), so the claim the pass opens later has its period.

determination_verdicts (#2322)

canopy-eligibility’s verdict on each of this service’s determinations, one row per determination_id (PK), written by the verdict consumer (src/verdict_subscriber.rs) in the inbox transaction that releases or drops the determination’s held outbox rows (ADR-002 Amendment 7). verdict is recorded or disowned (CHECK determination_verdicts_verdict_check); a recorded verdict replaces a disowned one and nothing replaces a recorded one. received_at is the consumer’s read of the decision clock for the delivery, bound by the consumer (no default). No foreign key: the consumer records the verdict canopy-eligibility sent whether or not a determination row holds the id.

event_outbox / event_inbox

The shared MQ pair; columns, indexes, parking and retention are on the data-models index.

Relationships

Diagram

Cross-service identifiers (ADR-001 boundary)

Every REFERENCES in the database is drawn above; nothing crosses to another service. Application-level only: household_id / person_id everywhere → canopy-persons; application_id on snap_applications, ievs_match_results, ievs_discrepancies, citizenship_verifications → canopy-applications; ievs_discrepancies.resolved_fact_id → a canopy-persons fact_id; overpayment_claims.determination_id → usually this service’s snap_determinations, unconstrained for back-rebill flows; overpayment_recomputes.claim_id / notice_id → overpayment_claims / canopy-notices, unconstrained; overpayment_claim_screens.claim_id → overpayment_claims, unconstrained, ipv_case_id → a canopy-appeals IPV case, and appeal_id / assessment_id / adverse_action_id → canopy-appeals' appeal and CB assessment and canopy-enrollment’s adverse action; redaction_keys.subject_id → snap_determinations.id by convention.

Retention

canopy-snap does NOT hold FTI. IEVS-sourced wage / UI / SSA-income data is a separate authorization (Social Security Act §1137, 42 USC §1320b-7; 7 CFR 272.8; the SNAP-specific CMA with SSA for the SSA-sourced matches) and lives in ievs_match_results, ievs_discrepancies, and ievs_verification_data — sited in canopy-snap per ADR-004 and never replicated to other services' databases. IEVS retention follows the FNS schedule (3-year minimum for access logs and match results). SNAP record retention proper is 7 CFR 272.1(f): no less than 3 years from the month of origin of each record — fiscal records and accountable documents 3 years from fiscal or administrative closure, (f)(1) (LII mirror, checked 2026-09-19; the eCFR refused this host). The longer of the two governs; archive moves are operator-driven, not migration-driven (ADR-016 forward-only).

Indexes

  • idx_snap_applications_household, idx_snap_applications_application, idx_snap_applications_status

  • idx_snap_determinations_application, idx_snap_determinations_household, idx_snap_determinations_status, idx_snap_determinations_determined_at

  • idx_snap_determinations_previous_unique — unique (previous_determination_id) WHERE previous_determination_id IS NOT NULL

  • idx_snap_determinations_household_created_id — (household_id, created_at DESC, id DESC), the per-household keyset list (#1576)

  • snap_determinations_operation_uq — unique (operation_id) WHERE operation_id IS NOT NULL (#788)

  • idx_determination_snapshots_as_of — (as_of)

  • idx_redaction_keys_subject — (subject_kind, subject_id); uq_redaction_keys_live_subject — unique (subject_kind, subject_id) WHERE shredded_at IS NULL

  • idx_ievs_verification_data_person, idx_ievs_verification_data_source

  • idx_snap_participations_person, idx_snap_participations_household, idx_snap_participations_program; idx_unique_participation — unique (person_id, program) WHERE active = true

  • idx_snap_student_person, idx_snap_student_household

  • abawd_tracking_person_active — unique (person_id) WHERE active = true; idx_abawd_tracking_household, idx_abawd_tracking_status

  • abawd_activity_month — unique (person_id, benefit_month)

  • idx_abawd_clock_person; idx_abawd_clock_person_period — unique (person_id, period_start)

  • snap_disqual_screening_household_idx — (household_id, person_id); snap_disqual_screening_type_idx — (screening_type, screening_result) WHERE active = true

  • ievs_results_application, ievs_results_person, ievs_results_source; idx_unique_ievs_match — unique (application_id, person_id, match_source)

  • ievs_discrepancies_application, ievs_discrepancies_person; ievs_discrepancies_status — (resolution_status) WHERE resolution_status = 'pending'

  • idx_citizenship_verification_application, idx_citizenship_verification_person

  • idx_tsnap_household, idx_tsnap_end_date

  • overpayment_claims_status; overpayment_claims_keyset — (created_at DESC, id DESC); overpayment_claims_assessment_once — unique (assessment_id) WHERE assessment_id IS NOT NULL; overpayment_claims_source_event_once — unique (source_event_id) WHERE source_event_id IS NOT NULL; overpayment_claims_by_appeal — (appeal_id) WHERE appeal_id IS NOT NULL

  • repayment_plans_by_claim, recoupment_ledger_by_claim, claim_adjustments_by_claim

  • idx_overpayment_recomputes_household_period — (household_id, covered_period_start, covered_period_end), the overlap guard

  • overpayment_recomputes_window_once — unique (baseline_determination_id, covered_period_start), the idempotency key (#2243)

  • overpayment_claim_screens_pending — (created_at, id) WHERE outcome = 'pending', the claim-screen pass’s drain order; overpayment_claim_screens_household — (household_id); overpayment_claim_screens_assessment_once — unique (assessment_id) WHERE assessment_id IS NOT NULL, how a re-emitted assessment finds its screen

  • event_outbox_*, event_inbox_unprocessed_idx, idx_event_inbox_parked — the generated partial indexes, described on the data-models index

Migration files

  • 20260326000000_create_snap_tables.sql — snap_applications, snap_determinations, ievs_verification_data

  • 20260328000000_create_snap_categorical.sql — snap_program_participations, snap_student_status

  • 20260329000000_create_abawd_tables.sql — abawd_tracking, abawd_monthly_activity, abawd_discretionary_exemptions, abawd_discretionary_exemption_grants, abawd_waiver_areas

  • 20260329000001_create_disqualification_screenings.sql — snap_disqualification_screenings

  • 20260330000000_create_ievs_tables.sql — ievs_match_results, ievs_discrepancies

  • 20260330000001_create_citizenship_verification.sql — citizenship_verifications

  • 20260402000000_add_constraints.sql — idx_unique_participation, idx_unique_ievs_match

  • 20260407000000_create_abawd_time_clock.sql — abawd_time_clock

  • 20260414000000_create_tsnap_certifications.sql — snap_tsnap_certifications

  • 20260508000000_create_event_outbox.sql — generated (index page)

  • 20260510000001_create_overpayments.sql — overpayment_claims, repayment_plans, recoupment_ledger

  • 20260516000000_create_event_inbox.sql — generated (index page)

  • 20260518004851_event_outbox_lease_columns.sql — generated (index page)

  • 20260620000000_add_discrepancy_resolved_by_sub.sql — ievs_discrepancies.resolved_by_sub (#677)

  • 20260621000000_create_determination_snapshots.sql — snap_determinations.snapshot_hash, determination_snapshots, its append-only trigger (#678, ADR-028)

  • 20260622000000_add_previous_determination_id.sql — snap_determinations.previous_determination_id self-FK + idx_snap_determinations_previous_unique (#683)

  • 20260624140000_create_redaction_keys.sql — redaction_keys and its one-way guard triggers (ADR-036)

  • 20260627000000_create_overpayment_recomputes.sql — overpayment_recomputes (#681)

  • 20260630000000_add_ievs_resolved_fact_id.sql — ievs_discrepancies.resolved_fact_id (#876)

  • 20260713000000_event_outbox_hold.sql — generated (index page)

  • 20260720000000_event_inbox_parking.sql — generated (index page)

  • 20260727000000_claim_provenance_adjustments.sql — claim provenance columns, the void path, claim_adjustments (#1104; canonical copy in crates/canopy-overpayments/migrations/)

  • 20260803000000_event_outbox_v7_pk_default.sql — generated (index page)

  • 20260804000000_v7_pk_defaults.sql — drops the gen_random_uuid() default on snap_tsnap_certifications.id (#1173)

  • 20260807000000_overpayments_v7_pk_defaults.sql — drops the id defaults on the four overpayment tables (#1173)

  • 20260810000000_snapshot_hash_not_null.sql — deletes pre-snapshot determinations and sets snapshot_hash NOT NULL (#911)

  • 20260815000000_event_outbox_claim_order_idx.sql — generated (index page)

  • 20260902000000_overpayment_claims_keyset_idx.sql — overpayment_claims_keyset (#1222)

  • 20260904000000_event_outbox_parking.sql — generated (index page)

  • 20261121000000_snap_determinations_trigger.sql — snap_determinations.trigger with its CHECK (#1213)

  • 20261206000000_snap_determinations_household_idx.sql — idx_snap_determinations_household_created_id (#1576)

  • 20261208000000_redaction_keys_live_subject_uq.sql — tombstones superseded live DEKs, then uq_redaction_keys_live_subject (#1458)

  • 20261209000000_uprov_b_snap_provenance.sql — effective_date_basis, benefit_effective_date, operation_id + snap_determinations_operation_uq (#788)

  • 20261223000000_snap_program_extension.sql — snap_determinations.program_extension (#1662)

  • 20261224000000_redaction_keys_rewrap_guard.sql — canopy_redaction_keys_one_way_guard() admits the KEK rewrap (wrapped_dek replaced + kek_version strictly increased on a live row) beside the shred (#2113)

  • 20270111000000_snap_determinations_signed_payload.sql — a delete cutover (#1984, after #911): inside the canopy.snapshot_maintenance window it clears determination_snapshots and every snap_determinations row (supersession pointers nulled first — no existing row carries the bytes it was signed with; devstacks refill through the reseed), then adds signed_payload BYTEA NOT NULL

  • 20270111000001_determination_status_check.sql — deletes any row outside approved / denied / sanctioned, every determination that supersedes it (directly or transitively) and their snapshots, inside the canopy.snapshot_maintenance window, then adds snap_determinations_status_verdict (#628)

  • 20270113000001_overpayment_discovered_by_actor.sql — the canonical stamp (crates/canopy-overpayments/migrations/canonical_discovered_by_actor.sql): overpayment_claims.discovered_by becomes TEXT + discovered_by_service; a guard aborts naming cargo xtask dev restart on any existing claim (none states a provable actor of a known class: NULL, nil, a body-supplied subject, or a recompute requester that may be a service account’s subject); then overpayment_claims_discovered_by_one_actor (= 1, VALID) (#1008)

  • 20270113000002_snap_actor_subjects.sql — overpayment_recomputes.requested_by becomes TEXT (DROP NOT NULL) + requested_by_service; ievs_discrepancies drops the UUID resolved_by, renames resolved_by_sub to resolved_by and adds resolved_by_service; abawd_discretionary_exemption_grants.granted_by and snap_disqualification_screenings.screened_by become TEXT; a guard aborts naming cargo xtask dev restart on any existing recompute or resolved discrepancy (their stored subject may be a service account’s, indistinguishable from a worker’s) and on a nil granted_by / screened_by; then the pair CHECKs, VALID (#1008)

  • 20270114000000_overpayment_recompute_verdicts.sql — a guard aborts naming cargo xtask dev restart on any existing recompute (its verdict statuses were never recorded, and the cents cannot recover them); then overpayment_recomputes.baseline_status (NOT NULL) + correct_status with overpayment_recomputes_baseline_status_verdict, overpayment_recomputes_correct_status_verdict and overpayment_recomputes_correct_status_iff_sized (#2325)

  • 20270114000001_overpayment_recompute_request_terms.sql — a guard aborts naming cargo xtask dev restart on any recompute missing claim_basis or discovered_in_qc_review (a no-claim row never recorded the request’s basis); then both columns SET NOT NULL (#2243)

  • 20270114000002_overpayment_claim_screens.sql — overpayment_claim_screens with its CHECKs and the three indexes (#2242)

  • 20270114000003_overpayment_recompute_outcome_check.sql — overpayment_recomputes_outcome_recorded, VALID (#2440)

  • 20270114000004_overpayment_recompute_window_key.sql — a guard aborts naming cargo xtask dev restart when two recomputes share a determination and window start; then drops UNIQUE (baseline_determination_id, correction_as_of) (implied by the new key) and adds overpayment_recomputes_window_once (#2243)

  • 20270117000000_redaction_keys_created_at_no_default.sql — drops the redaction_keys.created_at default: the shared canopy-db store binds created_at (the determination’s decision instant) and shredded_at (the redaction’s) from its caller, so an insert that names no created_at now fails instead of taking the database clock (#2475)

  • 20270118000000_overpayment_stamps_no_default.sql — the canonical stamp (crates/canopy-overpayments/migrations/canonical_stamps_no_default.sql): drops the now() defaults of overpayment_claims.created_at / updated_at, repayment_plans.created_at / updated_at, recoupment_ledger.occurred_at and claim_adjustments.created_at — the shared store binds every stamp from the writing request’s decision clock, so an insert that names no stamp now fails instead of taking the database clock (#2576)

  • 20270411000000_overpayment_claim_period.sql — the canonical stamp (crates/canopy-overpayments/migrations/canonical_claim_period.sql): overpayment_claims.period_first_month / period_last_month, nullable, with overpayment_claims_period_whole_months (#3567)

  • 20270411000001_snap_claims_require_period.sql — SNAP only: overpayment_claims_snap_period_required, and the two NOT NULL period columns of overpayment_claim_screens with their CHECK. It fails on a database holding any claim or screen row, since the months cannot be derived: re-seed (#3567)

  • 20270119000000_ievs_discrepancy_withdrawn.sql — ievs_discrepancies.withdrawn_at (TIMESTAMPTZ, nullable) with ievs_discrepancies_withdrawn_iff_stamped (resolution_status = 'withdrawn' exactly when withdrawn_at is set) and ievs_discrepancies_withdrawn_never_resolved; additive, VALID on every existing row (none is withdrawn): a verification re-run withdraws a discrepancy it no longer finds by status, never a delete (#2665)

  • 20270209000000_decision_stamps_no_default.sql — drops the defaults of every stamp the service’s production INSERTs bind themselves: snap_applications.created_at, snap_determinations.created_at, determination_snapshots.created_at, snap_tsnap_certifications.created_at / updated_at, overpayment_recomputes.created_at and overpayment_claim_screens.created_at. An insert that names no stamp now fails instead of taking the database clock, and cargo xtask migrations-lint refuses a new clock default (#2589)

  • 20270215000000_determination_verdicts.sql — the determination_verdicts table and its verdict CHECK (#2322)

  • 20270322000000_snap_abawd_discretionary_exemptions.sql — snap_abawd_discretionary_exemptions with its CHECKs and indexes (#3220)

  • 20270322000001_snap_abawd_regains.sql — snap_abawd_regains with its CHECKs and index (#3220)

  • 20270322000002_drop_writerless_abawd_pool_tables.sql — drops abawd_discretionary_exemption_grants and abawd_discretionary_exemptions, which nothing wrote; snap_abawd_discretionary_exemptions replaced them (#3235)

  • 20270324000000_determination_status_withheld.sql — ADR-052: replaces snap_determinations_status_verdict and the two overpayment_recomputes_*_status_verdict constraints so the list also admits withheld; no row is rewritten.

The eight generated files are byte-identical copies of crates/canopy-mq/outbox-migrations/ (the data-models index). All migrations are forward-only per ADR-016.

NOTE
The header comments of 20260326000000_create_snap_tables.sql (its header comment and the comment above ievs_verification_data) and 20260330000000_create_ievs_tables.sql (its second line) cite "7 USC §2025(e)" as the statute restricting IEVS data to SNAP. That cite is superseded: §2025(e) is the SSN section; the IEVS mandate is Social Security Act §1137 (42 USC §1320b-7), the use restriction on IEVS-received data is §1320b-7(a)(5), and 7 USC §2020(e)(8) is the SNAP disclosure safeguard — ADR-004 Amendment 6 (#2129), the legal_basis that compliance/data-tenancy-authorisation.toml [class.ievs] carries. An applied migration is immutable, so the header text stands as written; the siting the headers describe (IEVS tables in canopy-snap’s own database, per ADR-004) is unchanged.
Edit this page · default