Skip to content

Commit ab4f251

Browse files
committed
updating alembic migrations
1 parent b79e2d0 commit ab4f251

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

alembic/versions/003_form_templates.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
Create Date: 2026-06-26
66
77
Distinct from the legacy `template` table (int PK + uploaded PDF). This is the
8-
standards registry keyed by `form_type`, holding incident-schema field definitions and
9-
mappings. `fields` and `field_mappings_from_incident` use sa.JSON for
10-
consistency with migrations 001/002 and SQLite test-harness compatibility.
8+
standards registry keyed by `form_type`, holding incident-schema field definitions
9+
plus their visual layout. The `fields` JSON column (list of TemplateField objects,
10+
each with a nested `layout`) uses sa.JSON for consistency with migrations 001/002
11+
and SQLite test-harness compatibility.
1112
1213
`form_type` is a plain VARCHAR (not a Postgres ENUM): custom jurisdictions are
1314
registered here and are not part of the built-in FormType enum.
@@ -31,10 +32,9 @@ def upgrade() -> None:
3132
sa.Column("template_id", sa.Uuid(), primary_key=True),
3233
sa.Column("form_type", sqlmodel.sql.sqltypes.AutoString, nullable=False),
3334
sa.Column("display_name", sqlmodel.sql.sqltypes.AutoString, nullable=False),
34-
sa.Column("jurisdiction", sqlmodel.sql.sqltypes.AutoString, nullable=False),
35+
sa.Column("jurisdiction", sqlmodel.sql.sqltypes.AutoString, nullable=True),
3536
sa.Column("agency_type", sqlmodel.sql.sqltypes.AutoString, nullable=True),
3637
sa.Column("fields", sa.JSON, nullable=False),
37-
sa.Column("field_mappings_from_incident", sa.JSON, nullable=False),
3838
sa.Column("source_standard", sqlmodel.sql.sqltypes.AutoString, nullable=True),
3939
sa.Column("pdf_template_ref", sqlmodel.sql.sqltypes.AutoString, nullable=True),
4040
sa.Column("version", sqlmodel.sql.sqltypes.AutoString, nullable=False),

0 commit comments

Comments
 (0)