Merge pull request #242 from Hestia-Homes/feature/new-epc-tables

New EPC tables: make property_id and portfolio_id foreign keys nullable
This commit is contained in:
Daniel Roth 2026-04-24 12:11:10 +01:00 committed by GitHub
commit 9df415c80d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8627 additions and 2 deletions

View file

@ -0,0 +1,2 @@
ALTER TABLE "epc_property" ALTER COLUMN "property_id" DROP NOT NULL;--> statement-breakpoint
ALTER TABLE "epc_property" ALTER COLUMN "portfolio_id" DROP NOT NULL;

File diff suppressed because it is too large Load diff

View file

@ -1303,6 +1303,13 @@
"when": 1777026653433,
"tag": "0185_slimy_mindworm",
"breakpoints": true
},
{
"idx": 186,
"version": "7",
"when": 1777028605680,
"tag": "0186_equal_baron_zemo",
"breakpoints": true
}
]
}

View file

@ -416,10 +416,10 @@ export const epcProperty = pgTable(
{
id: bigserial("id", { mode: "bigint" }).primaryKey(),
propertyId: bigint("property_id", { mode: "bigint" })
.notNull()
// .notNull()
.references(() => property.id),
portfolioId: bigint("portfolio_id", { mode: "bigint" })
.notNull()
// .notNull()
.references(() => portfolio.id),
// Identity / admin