diff options
| author | joonhoekim <26rote@gmail.com> | 2025-11-05 16:46:43 +0900 |
|---|---|---|
| committer | joonhoekim <26rote@gmail.com> | 2025-11-05 16:46:43 +0900 |
| commit | a2c78d3a00c569a37ab93f65b58a11ba3519b596 (patch) | |
| tree | 1909ff3d52bb6f17a5b376d332255291cc71ecf5 /db/schema/knox/pending-actions.ts | |
| parent | 208ed7ff11d0f822d3d243c5833d31973904349e (diff) | |
(김준회) 실사의뢰/실사재의뢰 누락된 userId 추가해서 pendingActions에 추가하도록 변경
Diffstat (limited to 'db/schema/knox/pending-actions.ts')
| -rw-r--r-- | db/schema/knox/pending-actions.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/db/schema/knox/pending-actions.ts b/db/schema/knox/pending-actions.ts index e909dc27..ef41dca7 100644 --- a/db/schema/knox/pending-actions.ts +++ b/db/schema/knox/pending-actions.ts @@ -20,10 +20,12 @@ export const pendingActions = knoxSchema.table("pending_actions", { // 기본 정보 id: serial("id").primaryKey(), - // 결재 연결 (approvalLogs의 apInfId 참조) - apInfId: text("ap_inf_id") - .references(() => approvalLogs.apInfId, { onDelete: "cascade" }) - .notNull(), + // 결재 연결 (approvalLogs의 apInfId와 논리적으로 연결) + // 주의: FK 제약 조건을 사용하지 않음 + // 이유: pending_actions는 Knox 상신 전에 생성되지만, + // approval_logs는 Knox와 동기화되어 나중에 생성되므로 + // FK 제약이 있으면 Saga Pattern의 순서(DB → Knox)를 지킬 수 없음 + apInfId: text("ap_inf_id").notNull(), // 액션 정보 actionType: text("action_type").notNull(), // 예: 'vendor_investigation_request', 'purchase_order_request' |
