테이블 타입관리 에러

This commit is contained in:
kjs
2025-09-01 15:22:47 +09:00
parent b58cfc3db8
commit def192641b
9 changed files with 1365 additions and 277 deletions

View File

@@ -1,4 +1,5 @@
import { Request, Response } from "express";
import { Client } from "pg";
import { logger } from "../utils/logger";
import { AuthenticatedRequest } from "../types/auth";
import { ApiResponse } from "../types/common";
@@ -404,36 +405,25 @@ export async function updateColumnWebType(
return;
}
// PostgreSQL 클라이언트 생성
const client = new Client({
connectionString: process.env.DATABASE_URL,
});
const tableManagementService = new TableManagementService();
await tableManagementService.updateColumnWebType(
tableName,
columnName,
webType,
detailSettings
);
await client.connect();
logger.info(
`컬럼 웹 타입 설정 완료: ${tableName}.${columnName} = ${webType}`
);
try {
const tableManagementService = new TableManagementService(client);
await tableManagementService.updateColumnWebType(
tableName,
columnName,
webType,
detailSettings
);
const response: ApiResponse<null> = {
success: true,
message: "컬럼 웹 타입이 성공적으로 설정되었습니다.",
data: null,
};
logger.info(
`컬럼 웹 타입 설정 완료: ${tableName}.${columnName} = ${webType}`
);
const response: ApiResponse<null> = {
success: true,
message: "컬럼 웹 타입이 성공적으로 설정되었습니다.",
data: null,
};
res.status(200).json(response);
} finally {
await client.end();
}
res.status(200).json(response);
} catch (error) {
logger.error("컬럼 웹 타입 설정 중 오류 발생:", error);