mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
Merge pull request #269 from Hestia-Homes/feature/uploaded_file_id_in_magic_plan_plan
Add uploaded_file_id fk to magic_plan_plan table
This commit is contained in:
commit
418175f2c6
4 changed files with 9445 additions and 6 deletions
3
src/app/db/migrations/0202_furry_mister_sinister.sql
Normal file
3
src/app/db/migrations/0202_furry_mister_sinister.sql
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
ALTER TABLE "magic_plan_plan" ADD COLUMN "uploaded_file_id" bigint;--> statement-breakpoint
|
||||
ALTER TABLE "magic_plan_plan" ADD CONSTRAINT "magic_plan_plan_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;--> statement-breakpoint
|
||||
ALTER TABLE "magic_plan_plan" ADD CONSTRAINT "magic_plan_plan_uploaded_file_id_unique" UNIQUE("uploaded_file_id");
|
||||
9425
src/app/db/migrations/meta/0202_snapshot.json
Normal file
9425
src/app/db/migrations/meta/0202_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1415,6 +1415,13 @@
|
|||
"when": 1778602691863,
|
||||
"tag": "0201_known_sebastian_shaw",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 202,
|
||||
"version": "7",
|
||||
"when": 1778666596489,
|
||||
"tag": "0202_furry_mister_sinister",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,12 +1,16 @@
|
|||
import { pgTable, bigserial, text } from "drizzle-orm/pg-core";
|
||||
import { pgTable, bigserial, text, bigint } from "drizzle-orm/pg-core";
|
||||
import { uploadedFiles } from "../uploaded_files";
|
||||
|
||||
export const magicPlanPlan = pgTable(
|
||||
"magic_plan_plan",
|
||||
{
|
||||
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
||||
name: text("name"),
|
||||
address: text("address"),
|
||||
postcode: text("postcode"),
|
||||
magicPlanUid: text("magic_plan_uid").unique(),
|
||||
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
||||
name: text("name"),
|
||||
address: text("address"),
|
||||
postcode: text("postcode"),
|
||||
magicPlanUid: text("magic_plan_uid").unique(),
|
||||
uploadedFileId: bigint("uploaded_file_id", { mode: "bigint" })
|
||||
.unique()
|
||||
.references(() => uploadedFiles.id),
|
||||
},
|
||||
);
|
||||
Loading…
Add table
Reference in a new issue