[Pipeline C] Fix Form model, add migration and repo functions (#552, part 1) - #673
Merged
marcvergees merged 1 commit intoAug 17, 2026
Conversation
marcvergees
merged commit Aug 17, 2026
42fd829
into
fireform-core:development-approach-c
2 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part 1 of #552 (the data layer; the generate endpoint, fill task, and retrieval endpoints
follow in later PRs).
Fixes the v1 Form model to match the form-record.yaml contract and the agreed design (forms
link the incident, not the extract; keyed by template; batch is a grouping key, no Batch
table):
batch_id, per the scope decision (no Batch table in Single Form generation - API Contracts #552; Batch form generation - API Contracts #554 can add one if it needs it).
incident, so forms don't link it directly).
Migration 005 (down_revision 004) uses batch_alter_table for SQLite/Postgres portability.
Verified on both: the full suite (454) passes on SQLite, and I ran upgrade → downgrade 004 →
upgrade → alembic check against a real Postgres 17 container — all clean, so the FK
drop/re-add works with the actual Postgres constraint names.
Repository functions for the v1 Form model: create_generated_form, get_form,
list_forms_by_batch, update_form (named to avoid colliding with the legacy create_form, which
targets the old FormSubmission and is untouched).
Note: the downgrade re-adds extract_id as NOT NULL, which assumes the forms table is empty -
true now (generation isn't implemented yet), but a rollback caveat once the fill task lands.
@marcvergees @vharkins1 @chetanr25