diff options
| author | joonhoekim <26rote@gmail.com> | 2025-09-15 18:58:07 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-09-15 18:58:07 +0900 |
| commit | 2b490956c9752c1b756780a3461bc1c37b6fe0a7 (patch) | |
| tree | b0b8a03c8de5dfce4b6c7373a9d608306e9147c0 /db | |
| parent | e7818a457371849e29519497ebf046f385f05ab6 (diff) | |
(김준회) AVL 관리 및 상세 - 기능 구현 1차
+ docker compose 내 오류 수정
Diffstat (limited to 'db')
| -rw-r--r-- | db/schema/avl/avl.ts | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/db/schema/avl/avl.ts b/db/schema/avl/avl.ts index addbba94..d2aac795 100644 --- a/db/schema/avl/avl.ts +++ b/db/schema/avl/avl.ts @@ -1,4 +1,4 @@ -import { pgTable, text, boolean, integer, timestamp, varchar, decimal } from "drizzle-orm/pg-core"; +import { pgTable, boolean, integer, timestamp, varchar, decimal, json } from "drizzle-orm/pg-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; // AVL 리스트 테이블 (프로젝트 AVL 및 선종별 표준 AVL 리스트) @@ -17,6 +17,9 @@ export const avlList = pgTable("avl_list", { htDivision: varchar("ht_division", { length: 10 }), // H=Hull, T=Top, 공통 rev: integer("rev").default(1), // 리비전 정보 + // 히스토리 관리 + vendorInfoSnapshot: json("vendor_info_snapshot"), // AVL 생성 시점의 vendorInfo 현황 스냅샷 + // 타임스탬프 createdAt: timestamp("created_at").defaultNow(), // 등재일 createdBy: varchar("created_by", { length: 50 }), // 등재자 @@ -29,10 +32,18 @@ export const avlVendorInfo = pgTable("avl_vendor_info", { // 기본 식별자 id: integer("id").primaryKey().generatedAlwaysAsIdentity(), + isTemplate: boolean("is_template").default(false), // false: 프로젝트 AVL의 레코드임, true: 표준 AVL의 레코드임 + + // 표준 AVL용 필드들 (isTemplate=true일 경우) + constructionSector: varchar("construction_sector", { length: 10 }), // 공사부문 (표준 AVL일 경우) + shipType: varchar("ship_type", { length: 50 }), // 선종 (표준 AVL일 경우) + avlKind: varchar("avl_kind", { length: 50 }), // AVL 종류 (표준 AVL일 경우) + htDivision: varchar("ht_division", { length: 10 }), // H/T 구분 (표준 AVL일 경우) + projectCode: varchar("project_code", { length: 50 }), // 프로젝트코드 (프로젝트 AVL일 경우) - // AVL 리스트와의 관계 (외래키) - avlListId: integer("avl_list_id").references(() => avlList.id), + // AVL 리스트와의 관계 (자식이 먼저 생기므로.. 제약조건 없는 외래키) + avlListId: integer("avl_list_id"), // 제안방향 ownerSuggestion: boolean("owner_suggestion").default(false), // 선주 제안사인 경우 |
