- Integrated `TableManagementService` to validate unique constraints before insert, update, and upsert actions in various controllers, including `dataflowExecutionController`, `dynamicFormController`, and `tableManagementController`.
- Improved error handling in `errorHandler` to provide detailed messages indicating which field has a unique constraint violation.
- Updated the `formatPgError` utility to extract and display specific column labels for unique constraint violations, enhancing user feedback.
- Adjusted the table schema retrieval to include company-specific nullable and unique constraints, ensuring accurate representation of database rules.
These changes improve data integrity by preventing duplicate entries and enhance user experience through clearer error messages related to unique constraints.
문제:
- UPDATE 액션 실행 시 ID 필요 에러
- executeUpdate가 하드코딩된 id 필드만 찾음
- 실제 테이블 기본키는 다를 수 있음
해결:
1. 테이블 기본키 동적 조회
2. 기본키 값 동적 추출
3. 동적 UPDATE 쿼리 생성
4. 상세 로깅 추가
결과:
- 모든 테이블의 UPDATE 동작
- 동적 기본키 처리
현재 상황 분석 및 문서화:
컨트롤러 레이어:
- ✅ adminController.ts (28개) 완료
- ✅ screenFileController.ts (2개) 완료
- 🔄 남은 파일 (12개 호출):
* webTypeStandardController.ts (11개)
* fileController.ts (1개)
Routes & Services:
- ddlRoutes.ts (2개)
- companyManagementRoutes.ts (2개)
- multiConnectionQueryService.ts (4개)
Config:
- database.ts (4개 - 제거 예정)
새로운 계획서:
- PHASE4_REMAINING_PRISMA_CALLS.md (상세 전환 계획)
- 파일별 Prisma 호출 상세 분석
- 전환 패턴 및 우선순위 정리
전체 진행률: 445/444 (100.2%)
남은 작업: 12개 (추가 조사 필요한 파일 제외)