[agent-pipeline] pipe-20260303124213-d7zo round-3

This commit is contained in:
DDD1542 2026-03-03 21:53:46 +09:00
parent 0d71e79c54
commit d9d18c1922
2 changed files with 33 additions and 0 deletions

View File

@ -345,11 +345,13 @@ app.listen(PORT, HOST, async () => {
runDashboardMigration, runDashboardMigration,
runTableHistoryActionMigration, runTableHistoryActionMigration,
runDtgManagementLogMigration, runDtgManagementLogMigration,
runApprovalSystemMigration,
} = await import("./database/runMigration"); } = await import("./database/runMigration");
await runDashboardMigration(); await runDashboardMigration();
await runTableHistoryActionMigration(); await runTableHistoryActionMigration();
await runDtgManagementLogMigration(); await runDtgManagementLogMigration();
await runApprovalSystemMigration();
} catch (error) { } catch (error) {
logger.error(`❌ 마이그레이션 실패:`, error); logger.error(`❌ 마이그레이션 실패:`, error);
} }

View File

@ -2,6 +2,37 @@ import { PostgreSQLService } from "./PostgreSQLService";
import fs from "fs"; import fs from "fs";
import path from "path"; import path from "path";
/**
*
* approval_definitions, approval_line_templates, approval_line_template_steps,
* approval_requests, approval_lines
*/
export async function runApprovalSystemMigration() {
try {
console.log("🔄 결재 시스템 마이그레이션 시작...");
const sqlFilePath = path.join(
__dirname,
"../../db/migrations/100_create_approval_system.sql"
);
if (!fs.existsSync(sqlFilePath)) {
console.log("⚠️ 마이그레이션 파일이 없습니다:", sqlFilePath);
return;
}
const sqlContent = fs.readFileSync(sqlFilePath, "utf8");
await PostgreSQLService.query(sqlContent);
console.log("✅ 결재 시스템 마이그레이션 완료!");
} catch (error) {
console.error("❌ 결재 시스템 마이그레이션 실패:", error);
if (error instanceof Error && error.message.includes("already exists")) {
console.log(" 테이블이 이미 존재합니다.");
}
}
}
/** /**
* *
* dashboard_elements custom_title, show_header * dashboard_elements custom_title, show_header