From 519d01ed0a2e40c353d0afcccd4b7a83483f7eaf Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Wed, 12 Nov 2025 18:58:10 +0900 Subject: (김준회) Document Numbering Rule(해양): DOC_CLASS 1글자로 제한 (SWP측 제약), DOC_CLASS에서 코드 컬럼 제거 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/schema/docu-list-rule.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'db') diff --git a/db/schema/docu-list-rule.ts b/db/schema/docu-list-rule.ts index 62a770b4..0d1f668a 100644 --- a/db/schema/docu-list-rule.ts +++ b/db/schema/docu-list-rule.ts @@ -28,21 +28,15 @@ export const codeGroups = pgTable("code_groups", { export const documentClasses = pgTable("document_classes", { id: serial("id").primaryKey(), projectId: integer("project_id").notNull().references(() => projects.id), // 프로젝트 ID 참조 - code: varchar("code", { length: 50 }).notNull(), // CODE (자동 생성) - value: varchar("value", { length: 100 }), // 사용자가 선택할 수 있는 값 - description: varchar("description", { length: 200 }).notNull(), // 값의 의미 설명 + value: varchar("value", { length: 1 }).notNull(), // Document Class 값 (A-Z, 0-9 중 1자리) + description: varchar("description", { length: 200 }), // 값의 설명 (선택사항) codeGroupId: integer("code_group_id").references(() => codeGroups.id), // 참조하는 Code Group ID isActive: boolean("is_active").default(true), createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(), updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull(), }, (table) => { return { - // 같은 프로젝트 내에서 code는 유니크해야 함 - uniqueProjectCode: unique("unique_project_code").on( - table.projectId, - table.code - ), - // 같은 프로젝트 내에서 value는 유니크해야 함 (null 제외) + // 같은 프로젝트 내에서 value는 유니크해야 함 uniqueProjectValue: unique("unique_project_value").on( table.projectId, table.value -- cgit v1.2.3