diff --git a/backend-node/src/services/tableManagementService.ts b/backend-node/src/services/tableManagementService.ts index 10de1e73..608f8b96 100644 --- a/backend-node/src/services/tableManagementService.ts +++ b/backend-node/src/services/tableManagementService.ts @@ -2980,20 +2980,20 @@ export class TableManagementService { try { logger.info(`컬럼 입력타입 정보 조회: ${tableName}`); - // table_type_columns에서 입력타입 정보 조회 + // column_labels에서 입력타입 정보 조회 const rawInputTypes = await query( `SELECT - ttc.column_name as "columnName", - ttc.column_name as "displayName", - COALESCE(ttc.input_type, 'text') as "inputType", - COALESCE(ttc.detail_settings, '{}') as "detailSettings", - ttc.is_nullable as "isNullable", + cl.column_name as "columnName", + cl.column_label as "displayName", + COALESCE(cl.input_type, 'text') as "inputType", + '{}'::jsonb as "detailSettings", + ic.is_nullable as "isNullable", ic.data_type as "dataType" - FROM table_type_columns ttc + FROM column_labels cl LEFT JOIN information_schema.columns ic - ON ttc.table_name = ic.table_name AND ttc.column_name = ic.column_name - WHERE ttc.table_name = $1 - ORDER BY ttc.display_order, ttc.column_name`, + ON cl.table_name = ic.table_name AND cl.column_name = ic.column_name + WHERE cl.table_name = $1 + ORDER BY cl.column_name`, [tableName] ); diff --git a/frontend/lib/registry/components/table-list/TableListComponent.tsx b/frontend/lib/registry/components/table-list/TableListComponent.tsx index 35920020..435d0bd3 100644 --- a/frontend/lib/registry/components/table-list/TableListComponent.tsx +++ b/frontend/lib/registry/components/table-list/TableListComponent.tsx @@ -287,9 +287,11 @@ export const TableListComponent: React.FC = ({ // 컬럼 입력 타입 정보 가져오기 const inputTypes = await tableTypeApi.getColumnInputTypes(tableConfig.selectedTable); + console.log("📋 테이블의 inputType 정보:", tableConfig.selectedTable, inputTypes); const inputTypeMap: Record = {}; inputTypes.forEach((col: any) => { inputTypeMap[col.columnName] = col.inputType; + console.log(` - ${col.columnName}: ${col.inputType}`); }); tableColumnCache.set(cacheKey, { @@ -659,6 +661,7 @@ export const TableListComponent: React.FC = ({ // inputType 기반 포맷팅 (columnMeta에서 가져온 inputType 우선) const inputType = meta?.inputType || column.inputType; if (inputType === "number" || inputType === "decimal") { + console.log(`✅ 숫자 포맷팅 적용: ${column.columnName} = ${value} (inputType: ${inputType})`); if (value !== null && value !== undefined && value !== "") { const numValue = typeof value === "string" ? parseFloat(value) : value; if (!isNaN(numValue)) { @@ -666,6 +669,12 @@ export const TableListComponent: React.FC = ({ } } return String(value); + } else if (value !== null && value !== undefined && value !== "") { + // 숫자처럼 보이지만 inputType이 설정 안된 경우 + const numValue = typeof value === "string" ? parseFloat(value) : value; + if (!isNaN(numValue) && typeof value === "string" && /^\d+$/.test(value)) { + console.log(`⚠️ ${column.columnName}은 숫자 값이지만 inputType이 '${inputType}'로 설정되어 있어 포맷팅 안 됨`); + } } switch (column.format) {