mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
Merge pull request #208 from Hestia-Homes/feature/uploaded-files-table
Some checks failed
Next.js Build Check / build (push) Has been cancelled
Some checks failed
Next.js Build Check / build (push) Has been cancelled
Uploaded files table
This commit is contained in:
commit
ec1ada8c61
4 changed files with 6136 additions and 0 deletions
13
src/app/db/migrations/0158_ancient_colleen_wing.sql
Normal file
13
src/app/db/migrations/0158_ancient_colleen_wing.sql
Normal 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"
|
||||
);
|
||||
6080
src/app/db/migrations/meta/0158_snapshot.json
Normal file
6080
src/app/db/migrations/meta/0158_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -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
|
||||
}
|
||||
]
|
||||
}
|
||||
36
src/app/db/schema/uploaded_files.ts
Normal file
36
src/app/db/schema/uploaded_files.ts
Normal 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")
|
||||
}
|
||||
);
|
||||
Loading…
Add table
Reference in a new issue