mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-07-27 23:35:01 +00:00
Stop writing the superseded flat room-in-roof columns 🟩
Since #1665 landed, the full room-in-roof geometry is stored in and reconstructed from the epc_room_in_roof / epc_room_in_roof_surface child tables; the two flat columns on epc_building_part (room_in_roof_floor_area, room_in_roof_construction_age_band) are redundant duplicates that are written but never read. Remove the two SQLModel fields and their from_domain writes so the backend stops populating them — the required step BEFORE the FE migration drops the columns (dropping them while a backend that still writes them is live would 500 every save). Reconstruction already reads the child table (_to_room_in_roof), so the round-trip gate stays a hard zero. The columns remain in the DB (nullable, unwritten) until the FE drop migration runs. Deploy AFTER #1674 is stable in every environment; the FE column drop runs after this deploys everywhere. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
11ea2c2077
commit
46358abcd1
1 changed files with 0 additions and 7 deletions
|
|
@ -685,8 +685,6 @@ class EpcBuildingPartModel(SQLModel, table=True):
|
|||
# (-2.32 SAP). The prior allowlist "RdSAP uses defaults" was stale — the
|
||||
# cascade does honour the lodged U on the API path.
|
||||
wall_u_value: Optional[float] = Field(default=None)
|
||||
room_in_roof_floor_area: Optional[float] = Field(default=None)
|
||||
room_in_roof_construction_age_band: Optional[str] = Field(default=None)
|
||||
alt_wall_1_area: Optional[float] = Field(default=None)
|
||||
alt_wall_1_dry_lined: Optional[str] = Field(default=None)
|
||||
alt_wall_1_construction: Optional[int] = Field(default=None)
|
||||
|
|
@ -715,7 +713,6 @@ class EpcBuildingPartModel(SQLModel, table=True):
|
|||
def from_domain(
|
||||
cls, part: SapBuildingPart, epc_property_id: int
|
||||
) -> EpcBuildingPartModel:
|
||||
rir = part.sap_room_in_roof
|
||||
aw1 = part.sap_alternative_wall_1
|
||||
aw2 = part.sap_alternative_wall_2
|
||||
return cls(
|
||||
|
|
@ -746,10 +743,6 @@ class EpcBuildingPartModel(SQLModel, table=True):
|
|||
rafter_insulation_thickness=part.rafter_insulation_thickness,
|
||||
wall_is_basement=part.wall_is_basement,
|
||||
wall_u_value=part.wall_u_value,
|
||||
room_in_roof_floor_area=float(rir.floor_area) if rir else None,
|
||||
room_in_roof_construction_age_band=(
|
||||
rir.construction_age_band if rir else None
|
||||
),
|
||||
alt_wall_1_area=aw1.wall_area if aw1 else None,
|
||||
alt_wall_1_dry_lined=aw1.wall_dry_lined if aw1 else None,
|
||||
alt_wall_1_construction=aw1.wall_construction if aw1 else None,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue