mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-30 12:55:02 +00:00
add magicplan tables
This commit is contained in:
parent
f8bbb19b07
commit
a8c5e7e923
5 changed files with 69 additions and 0 deletions
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),
|
||||
width_m: real("width_m"),
|
||||
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"),
|
||||
},
|
||||
);
|
||||
10
src/app/db/schema/magic_plan/plan.ts
Normal file
10
src/app/db/schema/magic_plan/plan.ts
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
import { pgTable, bigserial, text } from "drizzle-orm/pg-core";
|
||||
|
||||
export const magicPlanPlan = pgTable(
|
||||
"magic_plan_plan",
|
||||
{
|
||||
id: bigserial("id", { mode: "bigint" }).primaryKey(),
|
||||
planName: text("plan_name"),
|
||||
address: text("address"),
|
||||
},
|
||||
);
|
||||
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"),
|
||||
width_m: real("width_m"),
|
||||
length_m: real("length_m"),
|
||||
area_m2: 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),
|
||||
width_m: real("width_m"),
|
||||
height_m: real("width_m"),
|
||||
area_m2: real("area_m2"),
|
||||
opening_type: text("opening_type"),
|
||||
},
|
||||
);
|
||||
Loading…
Add table
Reference in a new issue