Merge branch 'main' of http://39.117.244.52:3000/kjs/ERP-node into feature/v2-unified-renewal
This commit is contained in:
@@ -2415,11 +2415,19 @@ export class TableManagementService {
|
||||
}
|
||||
|
||||
// SET 절 생성 (수정할 데이터) - 먼저 생성
|
||||
// 🔧 테이블에 존재하는 컬럼만 UPDATE (가상 컬럼 제외)
|
||||
const setConditions: string[] = [];
|
||||
const setValues: any[] = [];
|
||||
let paramIndex = 1;
|
||||
const skippedColumns: string[] = [];
|
||||
|
||||
Object.keys(updatedData).forEach((column) => {
|
||||
// 테이블에 존재하지 않는 컬럼은 스킵
|
||||
if (!columnTypeMap.has(column)) {
|
||||
skippedColumns.push(column);
|
||||
return;
|
||||
}
|
||||
|
||||
const dataType = columnTypeMap.get(column) || "text";
|
||||
setConditions.push(
|
||||
`"${column}" = $${paramIndex}::${this.getPostgreSQLType(dataType)}`
|
||||
@@ -2430,6 +2438,10 @@ export class TableManagementService {
|
||||
paramIndex++;
|
||||
});
|
||||
|
||||
if (skippedColumns.length > 0) {
|
||||
logger.info(`⚠️ 테이블에 존재하지 않는 컬럼 스킵: ${skippedColumns.join(", ")}`);
|
||||
}
|
||||
|
||||
// WHERE 조건 생성 (PRIMARY KEY 우선, 없으면 모든 원본 데이터 사용)
|
||||
let whereConditions: string[] = [];
|
||||
let whereValues: any[] = [];
|
||||
|
||||
Reference in New Issue
Block a user