diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-08-21 06:57:36 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-08-21 06:57:36 +0000 |
| commit | 02b1cf005cf3e1df64183d20ba42930eb2767a9f (patch) | |
| tree | e932c54d5260b0e6fda2b46be2a6ba1c3ee30434 /db/schema/information.ts | |
| parent | d78378ecd7ceede1429359f8058c7a99ac34b1b7 (diff) | |
(대표님, 최겸) 설계메뉴추가, 작업사항 업데이트
설계메뉴 - 문서관리
설계메뉴 - 벤더 데이터
gtc 메뉴 업데이트
정보시스템 - 메뉴리스트 및 정보 업데이트
파일 라우트 업데이트
엑셀임포트 개선
기본계약 개선
벤더 가입과정 변경 및 개선
벤더 기본정보 - pq
돌체 오류 수정 및 개선
벤더 로그인 과정 이메일 오류 수정
Diffstat (limited to 'db/schema/information.ts')
| -rw-r--r-- | db/schema/information.ts | 41 |
1 files changed, 34 insertions, 7 deletions
diff --git a/db/schema/information.ts b/db/schema/information.ts index 43d0d0c7..f20723d5 100644 --- a/db/schema/information.ts +++ b/db/schema/information.ts @@ -1,4 +1,5 @@ -import { pgTable, varchar, timestamp, serial, boolean, text as textArea } from "drizzle-orm/pg-core";
+import { pgTable, varchar, timestamp, serial, boolean, text as textArea, integer } from "drizzle-orm/pg-core";
+import { relations } from "drizzle-orm";
// 페이지별 인포메이션 관리 테이블
export const pageInformation = pgTable("page_information", {
@@ -10,11 +11,6 @@ export const pageInformation = pgTable("page_information", { informationContent: textArea("information_content").notNull(), // 설명 내용
- // 첨부파일 정보
- attachmentFileName: varchar("attachment_file_name", { length: 255 }), // 첨부파일 원본명
- attachmentFilePath: varchar("attachment_file_path", { length: 1024 }), // 첨부파일 저장 경로
- attachmentFileSize: varchar("attachment_file_size", { length: 50 }), // 첨부파일 크기
-
// 활성화 여부
isActive: boolean("is_active").default(true).notNull(), // 활성화 여부
@@ -23,5 +19,36 @@ export const pageInformation = pgTable("page_information", { updatedAt: timestamp("updated_at").defaultNow().notNull(),
});
+// 첨부파일 테이블
+export const informationAttachments = pgTable("information_attachments", {
+ id: serial("id").primaryKey(),
+
+ // 인포메이션 ID (외래키)
+ informationId: integer("information_id").notNull().references(() => pageInformation.id, { onDelete: "cascade" }),
+
+ // 파일 정보
+ fileName: varchar("file_name", { length: 255 }).notNull(), // 원본 파일명
+ filePath: varchar("file_path", { length: 1024 }).notNull(), // 저장된 파일 경로
+ fileSize: varchar("file_size", { length: 50 }).notNull(), // 파일 크기
+
+ // 메타데이터
+ createdAt: timestamp("created_at").defaultNow().notNull(),
+ updatedAt: timestamp("updated_at").defaultNow().notNull(),
+});
+
+// 관계 설정
+export const pageInformationRelations = relations(pageInformation, ({ many }) => ({
+ attachments: many(informationAttachments),
+}));
+
+export const informationAttachmentsRelations = relations(informationAttachments, ({ one }) => ({
+ information: one(pageInformation, {
+ fields: [informationAttachments.informationId],
+ references: [pageInformation.id],
+ }),
+}));
+
export type PageInformation = typeof pageInformation.$inferSelect;
-export type NewPageInformation = typeof pageInformation.$inferInsert;
\ No newline at end of file +export type NewPageInformation = typeof pageInformation.$inferInsert;
+export type InformationAttachment = typeof informationAttachments.$inferSelect;
+export type NewInformationAttachment = typeof informationAttachments.$inferInsert;
\ No newline at end of file |
