feature/v2-renewal #400

Merged
kjs merged 11 commits from feature/v2-renewal into main 2026-03-04 23:03:04 +09:00
2 changed files with 33 additions and 0 deletions
Showing only changes of commit d9d18c1922 - Show all commits

View File

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

View File

@ -2,6 +2,37 @@ import { PostgreSQLService } from "./PostgreSQLService";
import fs from "fs";
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