canopy-medicaid Data Model

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

Tables

Table Purpose

medicaid_applications

One row per Medicaid/CHIP application from canopy-eligibility: application_id, household_id, pathway ∈ {magi, non_magi, both, chip}, status (starts pending). Every medicaid_application_id below references it.

magi_income (PAMMS 2669)

MAGI income per budget-group member: gross and monthly-normalised amounts, is_countable / is_earned, the 1040 adjustment pair (magi_adjustment_type, magi_adjustment_amount), the before-tax deduction pair, self_employment_expenses, the child-dependent exclusion pair (PAMMS 2610), source ∈ {self_report, fti, fdsh, employer, collateral}.

non_magi_factors

Non-MAGI (ABD) factors: category (the COA code across SSI / Pickle / DAC / widow(er) / EDWP / NOW / COMP / TEFRA / hospice / hospital / ICWP / nursing home / AMN / QDWI / QMB / SLMB / QI-1), age + verification, disability_status + disability_determination_date, Medicare enrollment, resource-test and income-test pairs, federal_benefit_rate, medical_spend_down_amount, level_of_care_met / length_of_stay_met.

fti_tax_data

Federal Tax Information (IRS Pub 1075 / IRC §6103(l)(21)); every read is wrapped in FTI audit logging. Only items (l)(21) names (#2238): tax_year A)(vi, filing_status A)(ii, adjusted_gross_income (26 CFR 301.6103(l)(21)-1(a)(2), where MAGI is unavailable) and taxable_social_security, the section 86 amount included in gross income a)(3. wages_salaries_tips, self_employment_income, the total social_security_benefits, and tax_exempt_interest and foreign_earned_income on their own (which (a)(1) discloses only as one aggregate) were dropped by 20270205000000_fti_tax_data_l21_items.sql.

fdsh_results

Federal Data Services Hub outcomes only (raw hub traffic stays in canopy-verification, ADR-004): hub_service ∈ {verify_ssa, verify_dhs, verify_irs, verify_cms}, verification_type ∈ {income, citizenship, incarceration, ssn, mec, immigration_status, quarterly_wage}, result_status ∈ {verified, not_verified, inconsistency, unavailable}, result_data JSONB.

clinical_assessments

HIPAA minimum-necessary clinical outcomes: assessment_type ∈ {disability, medical_necessity, functional_limitation, blindness, nursing_facility_level_of_care}, result ∈ {meets_criteria, does_not_meet, pending_review}. No diagnosis, narrative or treatment plan is stored.

medicaid_eligible_categories (PAMMS 2052)

Per-individual outcome for each COA the cascade evaluated: coa_code, coa_track ∈ {magi, non_magi, chip}, eligible, fpl_percentage + fpl_threshold, income_amount, resource_amount, spend_down_amount, denial_reason, evaluation_order. spend_down_amount is the medically-needy spenddown the non-MAGI ruleset computes, whether or not the category is eligible, rounded to cents (#2299). FM and Pregnant Medically Needy rows carry spend_down_amount (ex-spenddown, net income minus the MNIL). The AMN row’s spend_down_amount holds the ruleset’s abd_spend_down_amount (ex-abd-spenddown, net income minus the ABD MNIL). It is NULL for every other category, and wherever income is at or under the limit.

chip_applications (PAMMS 2194)

CHIP child enrollment: child_person_id, chip_type ∈ {standalone, medicaid_expansion}, premium_tier, monthly_premium + family_cap_premium, premium_exempt + premium_exemption_reason ∈ {under_6, foster_care, ai_an}, enrollment_effective_date.

pathways_hipp_referrals (PAMMS 2195)

HIPP cost-effectiveness: has_esi_access, esi_monthly_premium vs medicaid_capitation_rate, cost_effective (nullable while pending), status ∈ {pending, enrolled, not_cost_effective}.

medicaid_determinations

One signed determination per member (ADR-035): medicaid_application_id (FK), household_id, person_id, status (CHECK medicaid_determinations_status_verdict: approved / denied / sanctioned / withheld, #628), assigned_coa + assigned_coa_track, benefit_type, benefit_amount + benefit_unit, effective_date / expiration_date / renewal_date, continuous_eligibility_end, basis, denial_reason, denial_reason_codes TEXT[], fmap_rate, program_service_version, determined_at, the ADR-002 signature. Added later: snapshot_hash TEXT NOT NULL (the ADR-028 input-snapshot hash bound into the signature); trigger TEXT CHECK (trigger IN ('cola','fpl','ruleset-migration','change-report','renewal','worker-initiated','work-sanction')) (the last added by 20270321000000_medicaid_determinations_trigger_work_sanction.sql, #3219); previous_determination_id (no FK; at most one successor per prior via medicaid_determinations_supersession_uq); program TEXT NOT NULL CHECK (program IN ('medicaid','chip')) (medicaid_determinations_program_ck, #2942), the program the dispatch served — a person’s Medicaid and CHIP determinations are separate supersession chains, read by idx_medicaid_determinations_person_program_latest (household_id, person_id, program, determined_at DESC, id DESC). Its DEFAULT 'medicaid' backfilled every earlier row (all determined on medicaid dispatches) and was dropped by #2673. operation_id UUID and signed_payload BYTEA (#2673): the determination operation the dispatch claimed, signed in the envelope, and the exact bytes the signature covers, which the operation read serves verbatim; CHECK medicaid_determinations_operation_signed_ck (operation_id IS NULL OR signed_payload IS NOT NULL), and at most one row per operation and subject (medicaid_determinations_operation_subject_uq, unique (operation_id, person_id) WHERE operation_id IS NOT NULL; a repeat is 409 operation_already_determined).

determination_snapshots

The immutable ADR-028 input snapshot, one per member determination (each income, asset and expense leaf carries the fact's provenance when the caller sent one, #884): determination_id (PK, FK → medicaid_determinations), snapshot JSONB (the cascade order, per-COA results, the EE15 pick, the facts and household composition, resolved parameters, and the SOLQ projection when one was consumed), 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. Because Medicaid is FTI-bearing, the same transaction appends an fti_audit_log chain row for the snapshot’s creation (resource_type = 'determination_snapshot', fti_chain.rs). 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.

cmd_cascade_log

Audit trail of the CMD cascade, one row per (person, evaluated COA): evaluation_track ∈ {abd, family}, eligible, denial_reason, evaluation_order.

tanf_tma_coverage (42 USC 1396r-6)

Transitional Medical Assistance opened by the tanf.case_closed subscriber on an earnings-related closure: prior_coverage_end_date (the day the coverage before the transitional period ended; tanf_termination_date until 20270327000000, #3447), tma_start_date / tma_end_date, phase (default phase_1), qrf_due_dates JSONB, status (default active), closure_reason. No FK to medicaid_applications — the row may predate any Medicaid application.

medicaid_cmd_events

Change-in-circumstance lifecycle rows: household_id, ingested_at, processed_at (the settle delivery’s decision instant, the clock ingested_at and deadline_at come from, #2588), plus application_id, state TEXT NOT NULL DEFAULT 'received' CHECK (state IN ('received','requested','completed','failed','legacy')), deadline_at (ingest + [medicaid].cmd_clock_days from jurisdiction.toml; null under a pack that states no clock), determination_request_id, failure_code. Ingest inserts the row and stages the determination order in one transaction; the settle and fail consumers move it to completed / failed.

ele_consents (42 USC 1396a(e)(13))

Durable Express Lane consent written by the canopy-medicaid.ele-consent subscriber: household_id, person_id, application_id, consent_given_at (the event’s, else the consent delivery’s decision instant, #2588), consent_source CHECK (consent_source IN ('applicant_portal','worker_attestation')), the mandatory actor pair consent_recorded_by (the recording human’s OIDC subject, TEXT) / consent_recorded_by_service (the calling service’s principal) with ck_ele_consents_recorded_by_named (exactly one set; #1008), revoked_at, revoked_by (the revoking human’s OIDC subject, TEXT, human-only; no writer yet). ele_consents_active_per_person — one unrevoked consent per (household_id, person_id). No FK to medicaid_applications.

ele_status (42 USC 1396a(e)(13))

The current ELE flag per child: child_person_id, household_id, eligibility_tier CHECK (… IN ('medicaid','chip')) (#3423), current_status CHECK (… IN ('active','lapsed','revoked','pending_redetermination')), granted_at, expires_at, granting_program_history TEXT[], the denormalised child_date_of_birth (local age-out query), last_event_id / last_event_hash (the tail of the child’s chain), and the sweep triple sweep_claimed_at / sweep_claimed_by / sweep_next_attempt_at (bounded FOR UPDATE SKIP LOCKED claims for the hourly renewal / age-out sweeps, #1219). ele_status_active_per_child — one active row per child.

ele_grant_events (42 USC 1396a(e)(13), ADR-014)

Append-only, SHA-256 hash-chained log of every ELE grant / extend / renew / lapse / revoke: event_type CHECK (… IN ('granted','extended','renewed','lapsed','revoked')), source_program CHECK (source_program IS NULL OR … IN ('snap','tanf','caps','wic','none')), source_determination_id / source_application_id, eligibility_tier (same CHECK as ele_status), granted_at / expires_at, reason_code, the mandatory actor pair actor (a human’s OIDC subject, TEXT: an admin’s revoke) / actor_service (a service’s principal: canopy-medicaid on its own grants, renewals and lapses) with ck_ele_grant_events_actor_named (exactly one set; #1008), payload JSONB, previous_hash / event_hash, occurred_at. The hash input is framed (#1008): every field is its byte length (u32, big-endian) then its bytes; each nullable field (previous_hash, source_program, source_determination_id, source_application_id, eligibility_tier, granted_at, expires_at) opens with a presence byte (0x00 absent, 0x01 before the value) rather than a sentinel string; and the actor is one tagged field, N | H + subject | S + principal — so no boundary shift, no sentinel-valued input and no crafted subject collides, and every column except event_hash itself is hashed. Verified by GET /v1/ele/chain-status, which reports a malformed stored actor as a break at that row.

ele_deferred_approvals (42 USC 1396a(e)(13))

A source-program approval that arrived before consent, parked for replay by the consent subscriber: household_id, source_program CHECK (source_program IN ('snap','tanf')), source_determination_id / source_application_id, processed_at. ele_deferred_approvals_active_uq — one unprocessed row per (household_id, source_program), so a redelivered approval is a no-op.

fti_audit_log

The Pub 1075 §4 access log (identical DDL to canopy-tanf’s): accessed_by, accessed_at, purpose_code, data_elements_accessed TEXT[], originating_system, action (default read), resource_type, resource_id, request_id, ip_address, success, created_at, plus the ADR-014 chain columns previous_hash / event_hash. Trigger fti_audit_log_append_only rejects UPDATE / DELETE / TRUNCATE unless canopy.audit_maintenance is set.

fti_audit_log_archive

LIKE fti_audit_log INCLUDING ALL plus the chain columns; the Pub 1075 AU-11 7-year retention archive, guarded by fti_audit_log_archive_append_only.

overpayment_claims (42 CFR 433.300)

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), claim_amount_cents, 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) / discovered_by_service (a system caller’s client id, or canopy-medicaid for its own CB-assessment 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); 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); this service files its claims with none.

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), 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), requires_ops_review. claim_amount_cents is never rewritten.

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.

medicaid_demonstration_activity_reports (#3203)

Each person’s reported hours of one qualifying activity over one period, the input to the section 1115 adult demonstration’s qualifying-activity condition, written by POST /v1/demonstration-activity-reports (the demonstration-activity-report routes). A ledger: a later report for an overlapping period does not supersede an earlier one. id (MedicaidDemonstrationActivityReportId, app-supplied UUID v7), person_id, activity TEXT NOT NULL (a code from the pack’s [medicaid.adult_demonstration].activities, no CHECK: the vocabulary is pack data and the create refuses a code the pack does not list), hours NUMERIC(6,1) NOT NULL (CHECK >= 0), period_start DATE NOT NULL, period_end DATE NOT NULL (CHECK >= period_start), verification TEXT NOT NULL (CHECK ∈ {self_attested, verified}, the tokens of ActivityVerification), effective_date DATE NOT NULL, recorded_by TEXT NOT NULL (the recording worker’s OIDC subject, from the bearer of the user-only create route), created_at TIMESTAMPTZ NOT NULL (the request’s decision instant, bound by the writer with no default). Replaces pathways_qualifying_activities, which nothing read or wrote.

medicaid_cooperation_findings (#3189)

Each person’s cooperation in obtaining medical support or pursuing liable third parties (42 CFR 435.610(a)), as a worker found it, written by POST /v1/cooperation-findings (the cooperation-finding routes). Append-only: a change of status is a new row with a later effective_date. id (MedicaidCooperationFindingId, app-supplied UUID v7), person_id, kind TEXT NOT NULL (CHECK ∈ {medical_support, third_party_liability}, the tokens of CooperationKind), status TEXT NOT NULL (CHECK ∈ {non_cooperating, good_cause_claimed, good_cause_established, hearing_requested, cooperating}, the tokens of CooperationStatus), effective_date DATE NOT NULL, recorded_by TEXT NOT NULL (the recording worker’s OIDC subject, from the bearer of the user-only create route), created_at TIMESTAMPTZ NOT NULL (the request’s decision instant, bound by the writer with no default). A person refuses a kind on a date when that kind’s newest row effective by it, ties broken by created_at, is non_cooperating (refusals_on, src/store/cooperation.rs). The good-cause circumstance is not stored.

event_outbox / event_inbox

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

chain-v2 substrate (withdrawn and dormant, ADR-014 Amendment 6)

Installed by 20260910000000_chain_v2_substrate.sql (#1246) — the fti-family copy: canopy-medicaid is a chain SOURCE; the anchor store and verification state live only in canopy_security (canopy-security Data Model). Dormant: chain-v2 is withdrawn (ADR-041; ADR-014 Amendment 12), the #1279 cutover with it, and #1304 retires the substrate.

Table Purpose

chain_instances / chain_topology / chain_epochs / chain_sources / chain_heads

The shared registry substrate (identical DDL to the canopy-security copy): instance history, active pointer, fenced epochs (chain_epochs_one_open_v2 — one installing / active epoch per instance), the source registry chain_append_rows_fti validates its baked canopy-medicaid literal against, and pre-created heads. FKs: chain_epochs, chain_topology, chain_sources → chain_instances; chain_topology, chain_heads → chain_epochs.

fti_audit_log_v2 / fti_audit_log_archive_v2

The FTI family’s strict-from-row-one event store. fti_audit_log_v2 → chain_heads by (chain_instance_id, chain_family, chain_epoch, shard_id). Hashed business columns are derived from the payload — including the row id; request_id / ip_address / success ride the pinned unhashed ingress. fti_audit_log_archive_v2_id_uq (20261010000000) makes the archive id unique.

Views: chain_status_v, fti_hashed_preimage_v, fti_hashed_preimage_archive_v (the preimage views expose id since 20261010000000; SELECT granted to canopy_chain_verify). Functions: chain_head_lock, chain_append_rows_fti (SECURITY DEFINER — the only append path for the canopy_medicaid_app runtime role), chain_epoch_activate, chain_archive_prefix_fti, chain_purge_prefix_fti. Every object is owned by the NOLOGIN role canopy_chain_owner_medicaid. Contract: ADR-014 Amendment 6.

Relationships

Diagram

medicaid_determinations.previous_determination_id is a self-reference by convention (unique where set), not a FOREIGN KEY.

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 / applicant_person_id / tax_filer_person_id / spouse_person_id / child_person_id and the dependents_person_ids / pregnant_member_ids / ssi_recipient_ids arrays → canopy-persons; application_id on medicaid_applications and ele_consents → canopy-applications; ele_*.source_determination_id / source_application_id → canopy-snap / canopy-tanf; overpayment_claims.determination_id → usually this service’s medicaid_determinations, unconstrained for back-rebill flows; redaction_keys.subject_id → medicaid_determinations.id by convention. medicaid_cooperation_findings.recorded_by is the recording worker’s canopy subject (canopy-identity’s id for the worker, the delegation’s sub), stored as an opaque TEXT. tanf_tma_coverage, ele_consents, ele_status, ele_grant_events and ele_deferred_approvals deliberately carry no FK to medicaid_applications: they are written by cross-program subscribers and may precede any Medicaid application of record.

Retention

canopy-medicaid is the most data-class-dense service in the system. It holds:

  • FTI (IRS Publication 1075) in fti_tax_data, per ADR-004 Amendment 8. The table holds IRS return information, and its reads are audited under purpose codes citing 26 USC 6103(l)(21), the §6103 paragraph that names titles XIX and XXI. (l)(21)(A) discloses from the IRS to HHS, (B) lets HHS give a State agency any inconsistency, and ©(ii) limits a State agency’s use to eligibility. No statute or regulation delivers the values themselves to a State agency. The agency receives them from HHS through the CMS Data Services Hub under the CMS–IRS computer matching agreement, as IRS Publication 1075 §2.C.11.6 describes (ADR-004 Amendment 12, #2936). The table holds only the items (l)(21) names (#2238, ADR-004 Amendment 11). No table here holds data from Medicaid’s 26 USC 6103(l)(7) route, the IEVS SSA-held earnings and IRS unearned income of (l)(7)(D)(ii). FTI audit access is logged to fti_audit_log per Pub 1075 §4; minimum 7-year retention applies per Pub 1075 AU-11 (ADR-004 Amendment 2), with rows aging into fti_audit_log_archive and the ADR-014 hash chain extending across the boundary. fti_audit_log.purpose_code stores the purpose code (MEDICAID_ELIG, MEDICAID_MAGI, CHIP_ELIG), never the IRC citation, so no stored row carries the superseded IRC 6103(l)(12)(A).

  • HIPAA-scoped PHI in clinical_assessments. Minimum-necessary standard enforced at the schema level — only the eligibility-relevant outcome is stored; no clinical narrative, diagnosis, or treatment plan. HIPAA 45 CFR 164.530(j) requires 6-year retention of compliance documentation; Medicaid claim records per 42 CFR 431.17 require 3-year minimum from claim closure.

  • FDSH data in fdsh_results. Retained per the CMS data-use-agreement schedule.

The longest applicable floor governs. Archive moves and FTI-expiry purges are operator-driven; ADR-016 forbids destructive migrations.

Indexes

  • idx_medicaid_applications_application, idx_medicaid_applications_household, idx_medicaid_applications_status

  • idx_magi_income_application, idx_magi_income_person; idx_non_magi_factors_application, idx_non_magi_factors_person; idx_fti_tax_data_application, idx_fti_tax_data_person; idx_fdsh_results_application, idx_fdsh_results_person; idx_clinical_assessments_application

  • idx_medicaid_categories_application, idx_medicaid_categories_person, idx_medicaid_categories_coa; idx_chip_applications_medicaid, idx_chip_applications_child; idx_pathways_hipp_application

  • idx_medicaid_determinations_application, idx_medicaid_determinations_person, idx_medicaid_determinations_status; idx_medicaid_determinations_determined_at_id — (determined_at DESC, id DESC), the keyset list (#1195); idx_medicaid_determinations_person_program_latest — (household_id, person_id, program, determined_at DESC, id DESC), the per-(person, program) prior and newest reads (#2942; it replaced idx_medicaid_determinations_person_latest); medicaid_determinations_operation_subject_uq — unique (operation_id, person_id) WHERE operation_id IS NOT NULL (#2673); medicaid_determinations_supersession_uq — unique (previous_determination_id) WHERE previous_determination_id IS NOT NULL; idx_medicaid_determinations_household_det_id — (household_id, determined_at DESC, id DESC) (#1244)

  • 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_cmd_cascade_application, idx_cmd_cascade_person

  • idx_tma_coverage_household, idx_tma_coverage_person; idx_tma_coverage_status — (status) WHERE status = 'active'

  • idx_medicaid_cmd_events_household; idx_medicaid_cmd_events_unresolved — (ingested_at) WHERE state IN ('received','requested') (replaced idx_medicaid_cmd_events_unprocessed)

  • idx_medicaid_cooperation_findings_person — (person_id, kind, effective_date DESC, created_at DESC): a person’s newest-first list and the status-on-a-date read per kind (#3189)

  • idx_medicaid_demonstration_activity_reports_person — (person_id, effective_date DESC, created_at DESC): a person’s newest-first list and the per-person read of the reports effective by a date (#3203)

  • ele_consents_active_per_person — unique (household_id, person_id) WHERE revoked_at IS NULL; ele_consents_household_idx, ele_consents_application_idx

  • ele_status_active_per_child — unique (child_person_id) WHERE current_status = 'active'; ele_status_household_idx; ele_status_renewal_due_idx — (expires_at, id) WHERE current_status = 'active'; ele_status_aged_out_idx — (child_date_of_birth, id) WHERE current_status = 'active'

  • ele_grant_events_child_idx — (child_person_id, occurred_at DESC); ele_grant_events_household_idx — (household_id, occurred_at DESC); ele_grant_events_chain_order_idx — (occurred_at, id)

  • ele_deferred_approvals_active_uq — unique (household_id, source_program) WHERE processed_at IS NULL; ele_deferred_approvals_household_idx — (household_id) WHERE processed_at IS NULL

  • idx_fti_audit_accessed_at, idx_fti_audit_accessed_by, idx_fti_audit_purpose_code; idx_fti_audit_created_at — the ADR-014 §9 in-lock predecessor lookup and verify walk (#1197); idx_fti_audit_event_hash, idx_fti_audit_archive_event_hash

  • 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

  • chain-v2: chain_epochs_one_open_v2 — unique (chain_instance_id) WHERE state IN ('installing','active'); fti_audit_log_v2_shard_seq_idx — (chain_instance_id, chain_epoch, shard_id, chain_seq); fti_audit_log_v2_accessed_at_idx; fti_audit_log_archive_v2_id_uq

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

Migration files

  • 20260326000001_create_fti_audit_log.sql — fti_audit_log + fti_audit_log_archive

  • 20260407000000_create_medicaid_tables.sql — medicaid_applications, magi_income, non_magi_factors, fti_tax_data, fdsh_results, clinical_assessments, medicaid_eligible_categories, chip_applications, peachcare_premium_schedule, pathways_qualifying_activities, pathways_hipp_referrals, medicaid_determinations, cmd_cascade_log, and magi_household_snapshots (since dropped)

  • 20260413000000_create_tanf_tma_coverage.sql — tanf_tma_coverage

  • 20260417000000_create_express_lane_evaluations.sql — express_lane_evaluations (since dropped)

  • 20260425000000_add_fti_audit_hash_chain.sql — previous_hash / event_hash on the audit log and archive (ADR-014)

  • 20260508000000_create_event_outbox.sql — generated (index page)

  • 20260510000001_create_overpayments.sql — overpayment_claims, repayment_plans, recoupment_ledger

  • 20260512000000_create_medicaid_cmd_events.sql — medicaid_cmd_events (#448)

  • 20260516000000_create_event_inbox.sql — generated (index page)

  • 20260518004851_event_outbox_lease_columns.sql — generated (index page)

  • 20260605000000_create_ele_consents.sql — ele_consents

  • 20260605000001_create_ele_status.sql — ele_status

  • 20260605000002_create_ele_grant_events.sql — ele_grant_events

  • 20260606000000_drop_express_lane_evaluations.sql — drops express_lane_evaluations (and idx_ele_household with it)

  • 20260606010000_fti_audit_append_only_guard.sql — the statement-level append-only guard on the audit log and archive (#624)

  • 20260624000000_create_determination_snapshots.sql — medicaid_determinations.snapshot_hash, determination_snapshots, its append-only trigger (#685, ADR-028)

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

  • 20260630000000_drop_magi_household_snapshots.sql — drops magi_household_snapshots (#883)

  • 20260701000000_create_ele_deferred_approvals.sql — ele_deferred_approvals (#649)

  • 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)

  • 20260806000000_v7_pk_defaults.sql — drops the id defaults on tanf_tma_coverage, medicaid_cmd_events and the four ele_* tables (#1173)

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

  • 20260810000000_snapshot_hash_not_null.sql — sets snapshot_hash NOT NULL (#911)

  • 20260811000000_fti_audit_created_at_idx.sql — idx_fti_audit_created_at (#1197)

  • 20260815000000_event_outbox_claim_order_idx.sql — generated (index page)

  • 20260817000000_medicaid_determinations_list_keyset_idx.sql — idx_medicaid_determinations_determined_at_id (#1195)

  • 20260830000000_ele_sweep_claims.sql — the ele_status sweep triple; ele_status_renewal_due_idx rebuilt as (expires_at, id); ele_status_aged_out_idx (#1219)

  • 20260902000000_overpayment_claims_keyset_idx.sql — overpayment_claims_keyset (#1222)

  • 20260904000000_event_outbox_parking.sql — generated (index page)

  • 20260910000000_chain_v2_substrate.sql — the dormant chain-v2 fti substrate: roles, seven tables, three views, five functions (#1246)

  • 20261010000000_fti_preimage_id.sql — the preimage views gain id; fti_audit_log_archive_v2_id_uq; SELECT grant to canopy_chain_verify (#1205, #1206)

  • 20261126000000_medicaid_determinations_trigger.sql — trigger with its CHECK, previous_determination_id, idx_medicaid_determinations_person_latest, medicaid_determinations_supersession_uq (#1505)

  • 20261127000000_cmd_events_lifecycle.sql — medicaid_cmd_events lifecycle columns; idx_medicaid_cmd_events_unresolved replaces _unprocessed (#1506)

  • 20261201000000_medicaid_determinations_household_idx.sql — idx_medicaid_determinations_household_det_id (#1244)

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

  • 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)

  • 20270111000001_determination_status_check.sql — deletes any row outside approved / denied / sanctioned (the deleted requeue’s requeued / dismissed among them) with its snapshot, inside the canopy.snapshot_maintenance window, then adds medicaid_determinations_status_verdict (#628)

  • 20270113000000_ele_consents_actor.sql — ele_consents.consent_recorded_by becomes TEXT (DROP NOT NULL) + consent_recorded_by_service; a guard aborts naming cargo xtask dev restart on a consent recorded under the applicant’s own PersonId (the retired service-path fallback) or a nil subject; then ck_ele_consents_recorded_by_named (= 1, VALID) (#1008)

  • 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 service account’s subject indistinguishable from a worker’s); then overpayment_claims_discovered_by_one_actor (= 1, VALID) (#1008)

  • 20270113000002_ele_grant_events_actor.sql — ele_grant_events.actor_id is renamed actor and becomes TEXT + actor_service; ele_consents.revoked_by becomes TEXT; a guard aborts naming cargo xtask dev restart on any existing ele_grant_events row (hashed unframed, so the framed chain cannot verify or carry it over) or a nil revoked_by; then ck_ele_grant_events_actor_named (= 1, VALID) (#1008)

  • 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)

  • 20270205000000_fti_tax_data_l21_items.sql — #2238: fti_tax_data drops wages_salaries_tips, self_employment_income, social_security_benefits, tax_exempt_interest and foreign_earned_income: the first three named by neither IRC 6103(l)(21)(A) nor 26 CFR 301.6103(l)(21)-1, the last two named only inside (a)(1)'s single aggregate. A guard refuses to drop a column holding a value.

  • 20270206000000_medicaid_determinations_program.sql — #2942: medicaid_determinations.program (medicaid / chip, CHECK medicaid_determinations_program_ck; DEFAULT 'medicaid' backfills every earlier row and is an expand step #2673 drops); idx_medicaid_determinations_person_program_latest replaces idx_medicaid_determinations_person_latest

  • 20270207000000_medicaid_determinations_operation.sql — #2673: drops the default of program (the contract step of #2942’s expand); operation_id + signed_payload with medicaid_determinations_operation_signed_ck; medicaid_determinations_operation_subject_uq

  • 20270209000000_decision_stamps_no_default.sql — drops the defaults of every stamp the service’s production INSERTs bind themselves: medicaid_applications.received_at / created_at / updated_at, medicaid_eligible_categories.created_at, medicaid_determinations.determined_at / created_at, cmd_cascade_log.evaluated_at / created_at, determination_snapshots.created_at, tanf_tma_coverage.created_at / updated_at, medicaid_cmd_events.ingested_at / created_at and ele_grant_events.occurred_at (a clock_timestamp() default; the store binds the wall-clock instant it reads under the chain lock). 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)

  • 20270310000000_medicaid_cooperation_findings.sql — the medicaid_cooperation_findings table, its kind and status CHECKs and idx_medicaid_cooperation_findings_person (#3189)

  • 20270315000000_demonstration_activity_reports.sql — drops pathways_qualifying_activities (and its index); creates the medicaid_demonstration_activity_reports table, its hours, period and verification CHECKs and idx_medicaid_demonstration_activity_reports_person (#3203)

  • 20270322000000_ele_tier_chip.sql — #3423: the Express Lane tier above Medicaid becomes chip. Replaces ele_status_eligibility_tier_check and ele_grant_events_eligibility_tier_check with IN ('medicaid','chip') and rewrites ele_status rows in place. ele_grant_events hashes the tier into its chain, so its rows cannot be rewritten: the migration raises, naming the reset and re-seed (cargo xtask dev restart), when the table holds a row at the retired tier

  • 20270324000000_determination_status_withheld.sql — ADR-052: replaces medicaid_determinations_status_verdict so the list also admits withheld; no row is rewritten.

  • 20270327000000_tma_prior_coverage_end_date.sql — #3447: renames tanf_tma_coverage.tanf_termination_date to prior_coverage_end_date; values unchanged

  • 20270328000000_drop_premium_schedule.sql — #3425: drops peachcare_premium_schedule, which nothing wrote or read

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.

Edit this page · default