diff options
| author | joonhoekim <26rote@gmail.com> | 2025-07-02 00:17:29 +0000 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-07-02 00:17:29 +0000 |
| commit | 6a9ca20deddcdcbe8495cf5a73ec7ea5f53f9b55 (patch) | |
| tree | f48f3a84174f0be560fdf5ed7797fffd8a412a91 /db/schema | |
| parent | 4fb273b7fc85352183113f1240fc33f7d6c98328 (diff) | |
| parent | cee824301521c181000d501c0236db99079bbae4 (diff) | |
(merge) merged local commits
Diffstat (limited to 'db/schema')
| -rw-r--r-- | db/schema/index.ts | 3 | ||||
| -rw-r--r-- | db/schema/information.ts | 27 | ||||
| -rw-r--r-- | db/schema/notice.ts | 36 |
3 files changed, 66 insertions, 0 deletions
diff --git a/db/schema/index.ts b/db/schema/index.ts index 80aaffdb..99750e26 100644 --- a/db/schema/index.ts +++ b/db/schema/index.ts @@ -23,6 +23,9 @@ export * from './evaluationTarget'; export * from './evaluationCriteria'; export * from './projectGtc'; export * from './menu'; +export * from './information'; +export * from './qna'; +export * from './notice'; // MDG SOAP 수신용 export * from './MDG/mdg' diff --git a/db/schema/information.ts b/db/schema/information.ts new file mode 100644 index 00000000..43d0d0c7 --- /dev/null +++ b/db/schema/information.ts @@ -0,0 +1,27 @@ +import { pgTable, varchar, timestamp, serial, boolean, text as textArea } from "drizzle-orm/pg-core";
+
+// 페이지별 인포메이션 관리 테이블
+export const pageInformation = pgTable("page_information", {
+ id: serial("id").primaryKey(),
+
+ // 페이지 정보
+ pagePath: varchar("page_path", { length: 100 }).notNull().unique(), // 페이지 경로 (예: '/evcp/vendor-list', '/evcp/project-detail')
+ pageName: varchar("page_name", { length: 255 }).notNull(), // 페이지명 (menuConfig의 title에서 자동 저장)
+
+ 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(), // 활성화 여부
+
+ // 메타데이터
+ createdAt: timestamp("created_at").defaultNow().notNull(),
+ updatedAt: timestamp("updated_at").defaultNow().notNull(),
+});
+
+export type PageInformation = typeof pageInformation.$inferSelect;
+export type NewPageInformation = typeof pageInformation.$inferInsert;
\ No newline at end of file diff --git a/db/schema/notice.ts b/db/schema/notice.ts new file mode 100644 index 00000000..c7cfee93 --- /dev/null +++ b/db/schema/notice.ts @@ -0,0 +1,36 @@ +import { pgTable, varchar, text, timestamp, serial, boolean, integer } from "drizzle-orm/pg-core";
+import { relations } from "drizzle-orm";
+import { users } from "./users";
+
+// 페이지별 공지사항 관리 테이블
+export const notice = pgTable("notice", {
+ id: serial("id").primaryKey(),
+
+ // 페이지 정보
+ pagePath: varchar("page_path", { length: 100 }).notNull(), // 페이지 경로 (예: '/evcp/vendor-list')
+
+ // 공지사항 내용
+ title: varchar("title", { length: 500 }).notNull(), // 공지사항 제목
+ content: text("content").notNull(), // 공지사항 내용 (리치텍스트)
+
+ // 작성자 정보
+ authorId: integer("author_id").notNull().references(() => users.id), // 작성자 ID
+
+ // 활성화 여부
+ isActive: boolean("is_active").default(true).notNull(), // 활성화 여부
+
+ // 메타데이터
+ createdAt: timestamp("created_at").defaultNow().notNull(),
+ updatedAt: timestamp("updated_at").defaultNow().notNull(),
+});
+
+// Relations
+export const noticeRelations = relations(notice, ({ one }) => ({
+ author: one(users, {
+ fields: [notice.authorId],
+ references: [users.id],
+ }),
+}));
+
+export type Notice = typeof notice.$inferSelect;
+export type NewNotice = typeof notice.$inferInsert;
\ No newline at end of file |
