diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-01 11:48:43 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-01 11:48:43 +0000 |
| commit | cee824301521c181000d501c0236db99079bbae4 (patch) | |
| tree | b2197aa802c317c76670feb2af399838bac0365c /db/schema/notice.ts | |
| parent | 4c15b99d9586aa48693213c78c02fba4639ebb85 (diff) | |
(최겸) 인포메이선 db 수정 및 공지사항 db 추가
Diffstat (limited to 'db/schema/notice.ts')
| -rw-r--r-- | db/schema/notice.ts | 36 |
1 files changed, 36 insertions, 0 deletions
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 |
