summaryrefslogtreecommitdiff
path: root/db/schema/docu-list-rule.ts
diff options
context:
space:
mode:
author0-Zz-ang <s1998319@gmail.com>2025-08-25 09:23:30 +0900
committer0-Zz-ang <s1998319@gmail.com>2025-08-25 09:23:30 +0900
commitb12a06766e32e3c76544b1d12bec91653e1fe9db (patch)
tree57ca1ddff3342677d132e07b78fc03873a960255 /db/schema/docu-list-rule.ts
parentd38877eef87917087a4a217bea32ae84d6738a7d (diff)
docu-list-rule페이지 수정
Diffstat (limited to 'db/schema/docu-list-rule.ts')
-rw-r--r--db/schema/docu-list-rule.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/db/schema/docu-list-rule.ts b/db/schema/docu-list-rule.ts
index 27cace80..612c8045 100644
--- a/db/schema/docu-list-rule.ts
+++ b/db/schema/docu-list-rule.ts
@@ -56,6 +56,7 @@ export const documentClassOptions = pgTable("document_class_options_new", {
documentClassId: integer("document_class_id").notNull().references(() => documentClasses.id),
description: varchar("description", { length: 100 }).notNull(), // 하위 옵션 설명 (예: "General", "Technical")
optionCode: varchar("option_code", { length: 50 }), // 하위 옵션 코드 (선택사항)
+ sdq: integer("sdq").notNull(), // 순서 번호 (1, 2, 3, 4, 5, 6)
isActive: boolean("is_active").default(true),
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull(),
@@ -66,6 +67,11 @@ export const documentClassOptions = pgTable("document_class_options_new", {
table.documentClassId,
table.optionCode
),
+ // 같은 documentClassId 내에서 sdq는 유니크해야 함
+ uniqueDocumentClassSdq: unique("unique_document_class_sdq").on(
+ table.documentClassId,
+ table.sdq
+ ),
}
})
@@ -76,6 +82,7 @@ export const comboBoxSettings = pgTable("combo_box_settings", {
code: varchar("code", { length: 50 }).notNull(), // CODE (예: 100, 201, 202)
description: varchar("description", { length: 200 }).notNull(), // Description (예: General, Feed Gas Reveive)
remark: text("remark"), // Remark (비고)
+ sdq: integer("sdq").notNull(), // 순서 번호 (1, 2, 3, 4, 5, 6)
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull(),
}, (table) => {
@@ -85,6 +92,11 @@ export const comboBoxSettings = pgTable("combo_box_settings", {
table.codeGroupId,
table.code
),
+ // 같은 codeGroupId 내에서 sdq는 유니크해야 함
+ uniqueCodeGroupSdq: unique("unique_code_group_sdq").on(
+ table.codeGroupId,
+ table.sdq
+ ),
}
})