Merge pull request #336 from Hestia-Homes/not-null-lodged-on-baseline

Drop NotNull constraint on propertyBaselinePerformance lodged_ columns
This commit is contained in:
Daniel Roth 2026-07-01 08:50:19 +01:00 committed by GitHub
commit 1969043cee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 11680 additions and 4 deletions

View file

@ -0,0 +1,4 @@
ALTER TABLE "property_baseline_performance" ALTER COLUMN "lodged_sap_score" DROP NOT NULL;--> statement-breakpoint
ALTER TABLE "property_baseline_performance" ALTER COLUMN "lodged_epc_band" DROP NOT NULL;--> statement-breakpoint
ALTER TABLE "property_baseline_performance" ALTER COLUMN "lodged_co2_emissions_t_per_yr" DROP NOT NULL;--> statement-breakpoint
ALTER TABLE "property_baseline_performance" ALTER COLUMN "lodged_primary_energy_intensity_kwh_per_m2_yr" DROP NOT NULL;

File diff suppressed because it is too large Load diff

View file

@ -1737,6 +1737,13 @@
"when": 1782890623660,
"tag": "0248_optimal_bulldozer",
"breakpoints": true
},
{
"idx": 249,
"version": "7",
"when": 1782891723463,
"tag": "0249_rare_lightspeed",
"breakpoints": true
}
]
}

View file

@ -894,12 +894,12 @@ export const propertyBaselinePerformance = pgTable(
.references(() => property.id),
// Lodged performance (from gov EPC register)
lodgedSapScore: integer("lodged_sap_score").notNull(),
lodgedEpcBand: epcEnum("lodged_epc_band").notNull(),
lodgedCo2EmissionsTPerYr: real("lodged_co2_emissions_t_per_yr").notNull(),
lodgedSapScore: integer("lodged_sap_score"),
lodgedEpcBand: epcEnum("lodged_epc_band"),
lodgedCo2EmissionsTPerYr: real("lodged_co2_emissions_t_per_yr"),
lodgedPrimaryEnergyIntensityKwhPerM2Yr: integer(
"lodged_primary_energy_intensity_kwh_per_m2_yr",
).notNull(),
),
// Effective performance (what modelling scored against)
effectiveSapScore: integer("effective_sap_score").notNull(),