make file upload possible for nick

This commit is contained in:
Jun-te Kim 2025-11-11 20:20:18 +00:00
parent 6bb04a9a72
commit 1612841a8c
4 changed files with 4594 additions and 0 deletions

View file

@ -0,0 +1,10 @@
CREATE TABLE "files_from_surveyor" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"portfolio_id" bigint NOT NULL,
"property_id" bigint NOT NULL,
"s3_json_url" text NOT NULL,
"uploaded_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
ALTER TABLE "files_from_surveyor" ADD CONSTRAINT "files_from_surveyor_portfolio_id_portfolio_id_fk" FOREIGN KEY ("portfolio_id") REFERENCES "public"."portfolio"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
ALTER TABLE "files_from_surveyor" ADD CONSTRAINT "files_from_surveyor_property_id_property_id_fk" FOREIGN KEY ("property_id") REFERENCES "public"."property"("id") ON DELETE no action ON UPDATE no action;

File diff suppressed because it is too large Load diff

View file

@ -883,6 +883,13 @@
"when": 1762793952263,
"tag": "0125_steady_thunderbolts",
"breakpoints": true
},
{
"idx": 126,
"version": "7",
"when": 1762892339561,
"tag": "0126_third_hawkeye",
"breakpoints": true
}
]
}

View file

@ -0,0 +1,15 @@
import { pgTable, uuid, bigint, text, timestamp } from "drizzle-orm/pg-core";
import { portfolio } from "./portfolio";
import { property } from "./property";
export const filesFromSurveyor = pgTable("files_from_surveyor", {
id: uuid("id").defaultRandom().primaryKey(),
portfolioId: bigint("portfolio_id", { mode: "bigint" })
.notNull()
.references(() => portfolio.id),
propertyId: bigint("property_id", { mode: "bigint" })
.notNull()
.references(() => property.id),
s3JsonUrl: text("s3_json_url").notNull(),
uploadedAt: timestamp("uploaded_at").notNull().defaultNow(),
});