diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-22 02:57:31 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-22 02:57:31 +0000 |
| commit | cb34c5e1a61a20c954e12a8219d82dbdfbe50e13 (patch) | |
| tree | 61fdfd81c3f42da6064c5ec2b661f1ef17ae8681 /db/schema/knox/titles.ts | |
| parent | ee57cc221ff2edafd3c0f12a181214c602ed257e (diff) | |
(김준회) Knox API - 임직원 저장 구현
Diffstat (limited to 'db/schema/knox/titles.ts')
| -rw-r--r-- | db/schema/knox/titles.ts | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/db/schema/knox/titles.ts b/db/schema/knox/titles.ts new file mode 100644 index 00000000..338ba79b --- /dev/null +++ b/db/schema/knox/titles.ts @@ -0,0 +1,30 @@ +import { pgSchema, varchar, jsonb, timestamp, index, primaryKey } from "drizzle-orm/pg-core"; + +export const knoxSchema = pgSchema("knox"); + +export const title = knoxSchema.table( + "title", + { + companyCode: varchar("company_code", { length: 10 }).notNull(), + titleCode: varchar("title_code", { length: 20 }).notNull(), + + titleName: varchar("title_name", { length: 100 }), + enTitleName: varchar("en_title_name", { length: 100 }), + sortOrder: varchar("sort_order", { length: 10 }), + + // 전체 원본 JSON 데이터 저장 + raw: jsonb("raw").notNull(), + + createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(), + updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull(), + }, + (table) => { + return { + companyIdx: index("knox_title_company_idx").on(table.companyCode), + pk: primaryKey(table.companyCode, table.titleCode), + }; + } +); + +export type KnoxTitle = typeof title.$inferSelect; +export type NewKnoxTitle = typeof title.$inferInsert; |
