adding fields to energy assessment document

This commit is contained in:
Khalim Conn-Kowlessar 2024-09-04 11:15:12 +01:00
parent 42d56835be
commit e5a00d4454

View file

@ -148,6 +148,7 @@ export const DocumentType: [string, ...string[]] = [
"Evidence Report",
"Summary Information",
"Floor Plan",
"Scenario EPR",
];
export const DocumentTypeEnum = pgEnum("document_type", DocumentType);
@ -156,11 +157,19 @@ export const energyAssessmentDocuments = pgTable(
"energy_assessment_documents",
{
id: bigserial("id", { mode: "bigint" }).primaryKey(),
uprn: bigint("uprn", { mode: "bigint" }).notNull(),
energyAssessmentId: bigint("energy_assessment_id", {
mode: "bigint",
}).notNull(),
documentType: DocumentTypeEnum("document_type").notNull(),
documentLocation: text("document_location").notNull(),
// The uploaded at date is automatically created when a new record is added
uploadedAt: timestamp("uploaded_at", {
precision: 6,
withTimezone: true,
})
.notNull()
.defaultNow(),
}
);