Merge pull request #208 from Hestia-Homes/feature/uploaded-files-table
Some checks failed
Next.js Build Check / build (push) Has been cancelled

Uploaded files table
This commit is contained in:
Daniel Roth 2026-03-26 15:19:26 +00:00 committed by GitHub
commit ec1ada8c61
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6136 additions and 0 deletions

View file

@ -0,0 +1,13 @@
CREATE TYPE "public"."file_source" AS ENUM('pas hub', 'sharepoint', 'hubspot');--> statement-breakpoint
CREATE TYPE "public"."file_type" AS ENUM('photo_pack', 'site_note', 'rd_sap_site_note', 'pas_2023_ventilation', 'pas_2023_condition', 'pas_significance', 'par_photo_pack', 'pas_2023_property', 'pas_2023_occupancy');--> statement-breakpoint
CREATE TABLE "uploaded_files" (
"id" bigserial PRIMARY KEY NOT NULL,
"s3_file_bucket" text NOT NULL,
"s3_file_key" text NOT NULL,
"s3_upload_timestamp" timestamp with time zone NOT NULL,
"landlord_property_id" text,
"uprn" bigint,
"hubspot_listing_id" bigint,
"file_type" "file_type",
"file_source" "file_source"
);

File diff suppressed because it is too large Load diff

View file

@ -1107,6 +1107,13 @@
"when": 1774268836524,
"tag": "0157_cynical_serpent_society",
"breakpoints": true
},
{
"idx": 158,
"version": "7",
"when": 1774538269794,
"tag": "0158_ancient_colleen_wing",
"breakpoints": true
}
]
}

View file

@ -0,0 +1,36 @@
import { bigint, bigserial, pgEnum, pgTable, text, timestamp } from "drizzle-orm/pg-core";
export const fileType = pgEnum("file_type", [
"photo_pack",
"site_note",
"rd_sap_site_note",
"pas_2023_ventilation",
"pas_2023_condition",
"pas_significance",
"par_photo_pack",
"pas_2023_property",
"pas_2023_occupancy"
]);
export const fileSource = pgEnum("file_source", [
"pas hub",
"sharepoint",
"hubspot"
]);
export const uploadedFiles = pgTable(
"uploaded_files",
{
id: bigserial("id", { mode: "bigint" }).primaryKey(),
s3FileBucket: text("s3_file_bucket").notNull(),
s3FileKey: text("s3_file_key").notNull(),
s3UploadTimestamp: timestamp("s3_upload_timestamp", {
withTimezone: true
}).notNull(),
landlordPropertyId: text("landlord_property_id"),
uprn: bigint("uprn", { mode: "bigint" }),
hubspotListingId: bigint("hubspot_listing_id", { mode: "bigint" }),
fileType: fileType("file_type"),
source: fileSource("file_source")
}
);