add new fk column uploaded_file_id

This commit is contained in:
Daniel Roth 2026-04-28 16:08:31 +00:00
parent d6610f7327
commit b696f823a4
4 changed files with 8647 additions and 0 deletions

View file

@ -0,0 +1,2 @@
ALTER TABLE "epc_property" ADD COLUMN "uploaded_file_id" bigint;--> statement-breakpoint
ALTER TABLE "epc_property" ADD CONSTRAINT "epc_property_uploaded_file_id_uploaded_files_id_fk" FOREIGN KEY ("uploaded_file_id") REFERENCES "public"."uploaded_files"("id") ON DELETE no action ON UPDATE no action;

File diff suppressed because it is too large Load diff

View file

@ -1324,6 +1324,13 @@
"when": 1777364161220,
"tag": "0188_wild_morph",
"breakpoints": true
},
{
"idx": 189,
"version": "7",
"when": 1777392468614,
"tag": "0189_high_leech",
"breakpoints": true
}
]
}

View file

@ -15,6 +15,7 @@ import { portfolio, PortfolioStatus } from "./portfolio";
import { InferModel } from "drizzle-orm";
import { materialTypeEnum } from "./materials";
import { sql } from "drizzle-orm";
import { uploadedFiles } from "./uploaded_files";
// This is a placeholder for the property schema
export interface PropertyMeta {
@ -421,6 +422,8 @@ export const epcProperty = pgTable(
portfolioId: bigint("portfolio_id", { mode: "bigint" })
// .notNull()
.references(() => portfolio.id),
uploadedFileId: bigint("uploaded_file_id", { mode: "bigint" })
.references(() => uploadedFiles.id),
// Identity / admin
uprn: bigint("uprn", { mode: "bigint" }),