mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-30 12:55:02 +00:00
Merge pull request #259 from Hestia-Homes/feature/magicplan-tables
MagicPlan tables
This commit is contained in:
commit
ad55132f97
9 changed files with 9082 additions and 1 deletions
|
|
@ -12,7 +12,7 @@ services:
|
|||
- "3000:3000"
|
||||
volumes:
|
||||
- ..:/workspaces/assessment-model
|
||||
- ~/.gitconfig:/home/vscode/.gitconfig:ro
|
||||
- ~/.gitconfig:/home/vscode/.gitconfig
|
||||
# GitHub CLI auth from host (created by `gh auth login`). Used by the
|
||||
# postCreate skill installer to clone private Hestia-Homes repos.
|
||||
- ~/.config/gh:/home/vscode/.config/gh:ro
|
||||
|
|
|
|||
42
src/app/db/migrations/0192_brainy_silver_samurai.sql
Normal file
42
src/app/db/migrations/0192_brainy_silver_samurai.sql
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
CREATE TABLE "magic_plan_door" (
|
||||
"id" bigserial PRIMARY KEY NOT NULL,
|
||||
"magic_plan_room_id" bigint NOT NULL,
|
||||
"width_mm" real,
|
||||
"type" text
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "magic_plan_floor" (
|
||||
"id" bigserial PRIMARY KEY NOT NULL,
|
||||
"magic_plan_plan_id" bigint NOT NULL,
|
||||
"level" integer
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "magic_plan_plan" (
|
||||
"id" bigserial PRIMARY KEY NOT NULL,
|
||||
"name" text,
|
||||
"address" text,
|
||||
"postcode" text
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "magic_plan_room" (
|
||||
"id" bigserial PRIMARY KEY NOT NULL,
|
||||
"magic_plan_floor_id" bigint NOT NULL,
|
||||
"name" text,
|
||||
"width_m" real,
|
||||
"length_m" real,
|
||||
"area_m2" real
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "magic_plan_window" (
|
||||
"id" bigserial PRIMARY KEY NOT NULL,
|
||||
"magic_plan_room_id" bigint NOT NULL,
|
||||
"width_m" real,
|
||||
"height_m" real,
|
||||
"area_m2" real,
|
||||
"opening_type" text
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "magic_plan_door" ADD CONSTRAINT "magic_plan_door_magic_plan_room_id_magic_plan_room_id_fk" FOREIGN KEY ("magic_plan_room_id") REFERENCES "public"."magic_plan_room"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "magic_plan_floor" ADD CONSTRAINT "magic_plan_floor_magic_plan_plan_id_magic_plan_plan_id_fk" FOREIGN KEY ("magic_plan_plan_id") REFERENCES "public"."magic_plan_plan"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "magic_plan_room" ADD CONSTRAINT "magic_plan_room_magic_plan_floor_id_magic_plan_floor_id_fk" FOREIGN KEY ("magic_plan_floor_id") REFERENCES "public"."magic_plan_floor"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "magic_plan_window" ADD CONSTRAINT "magic_plan_window_magic_plan_room_id_magic_plan_room_id_fk" FOREIGN KEY ("magic_plan_room_id") REFERENCES "public"."magic_plan_room"("id") ON DELETE no action ON UPDATE no action;
|
||||
8962
src/app/db/migrations/meta/0192_snapshot.json
Normal file
8962
src/app/db/migrations/meta/0192_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1345,6 +1345,13 @@
|
|||
"when": 1777560763716,
|
||||
"tag": "0191_soft_ezekiel_stane",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 192,
|
||||
"version": "7",
|
||||
"when": 1778076192170,
|
||||
"tag": "0192_brainy_silver_samurai",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
14
src/app/db/schema/magic_plan/door.ts
Normal file
14
src/app/db/schema/magic_plan/door.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { pgTable, bigserial, bigint, text, real } from "drizzle-orm/pg-core";
|
||||
import { magicPlanRoom } from "./room";
|
||||
|
||||
export const magicPlanDoor = pgTable(
|
||||
"magic_plan_door",
|
||||
{
|
||||
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
||||
roomId: bigint("magic_plan_room_id", { mode: "bigint" })
|
||||
.notNull()
|
||||
.references(() => magicPlanRoom.id),
|
||||
widthMm: real("width_mm"),
|
||||
type: text("type"),
|
||||
},
|
||||
);
|
||||
13
src/app/db/schema/magic_plan/floor.ts
Normal file
13
src/app/db/schema/magic_plan/floor.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
import { pgTable, bigserial, bigint, integer } from "drizzle-orm/pg-core";
|
||||
import { magicPlanPlan } from "./plan";
|
||||
|
||||
export const magicPlanFloor = pgTable(
|
||||
"magic_plan_floor",
|
||||
{
|
||||
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
||||
planId: bigint("magic_plan_plan_id", { mode: "bigint" })
|
||||
.notNull()
|
||||
.references(() => magicPlanPlan.id),
|
||||
level: integer("level"),
|
||||
},
|
||||
);
|
||||
11
src/app/db/schema/magic_plan/plan.ts
Normal file
11
src/app/db/schema/magic_plan/plan.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import { pgTable, bigserial, text } from "drizzle-orm/pg-core";
|
||||
|
||||
export const magicPlanPlan = pgTable(
|
||||
"magic_plan_plan",
|
||||
{
|
||||
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
||||
name: text("name"),
|
||||
address: text("address"),
|
||||
postcode: text("postcode"),
|
||||
},
|
||||
);
|
||||
16
src/app/db/schema/magic_plan/room.ts
Normal file
16
src/app/db/schema/magic_plan/room.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { pgTable, bigserial, bigint, text, real } from "drizzle-orm/pg-core";
|
||||
import { magicPlanFloor } from "./floor";
|
||||
|
||||
export const magicPlanRoom = pgTable(
|
||||
"magic_plan_room",
|
||||
{
|
||||
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
||||
floorId: bigint("magic_plan_floor_id", { mode: "bigint" })
|
||||
.notNull()
|
||||
.references(() => magicPlanFloor.id),
|
||||
name: text("name"),
|
||||
widthM: real("width_m"),
|
||||
lengthM: real("length_m"),
|
||||
areaM2: real("area_m2"),
|
||||
},
|
||||
);
|
||||
16
src/app/db/schema/magic_plan/window.ts
Normal file
16
src/app/db/schema/magic_plan/window.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { pgTable, bigserial, bigint, text, real } from "drizzle-orm/pg-core";
|
||||
import { magicPlanRoom } from "./room";
|
||||
|
||||
export const magicPlanWindow = pgTable(
|
||||
"magic_plan_window",
|
||||
{
|
||||
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
||||
roomId: bigint("magic_plan_room_id", { mode: "bigint" })
|
||||
.notNull()
|
||||
.references(() => magicPlanRoom.id),
|
||||
widthM: real("width_m"),
|
||||
heightM: real("height_m"),
|
||||
areaM2: real("area_m2"),
|
||||
openingType: text("opening_type"),
|
||||
},
|
||||
);
|
||||
Loading…
Add table
Reference in a new issue