refactor: worker_id → user_id 전체 마이그레이션 (Phase 1-4)

sso_users.user_id를 단일 식별자로 통합. JWT에서 worker_id 제거,
department_id/is_production 추가. 백엔드 15개 모델, 11개 컨트롤러,
4개 서비스, 7개 라우트, 프론트엔드 32+ JS/11+ HTML 변환.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-05 13:13:10 +09:00
parent 2197cdb3d5
commit abd7564e6b
90 changed files with 1790 additions and 925 deletions

View File

@@ -286,7 +286,7 @@ const optimizedQueries = {
let baseQuery = `
SELECT w.*, d.department_name, COUNT(dwr.id) as report_count
FROM workers w
LEFT JOIN daily_work_reports dwr ON w.worker_id = dwr.worker_id
LEFT JOIN daily_work_reports dwr ON w.user_id = dwr.user_id
LEFT JOIN departments d ON w.department_id = d.department_id
`;
@@ -322,10 +322,10 @@ const optimizedQueries = {
countQuery += whereClause;
}
baseQuery += ' GROUP BY w.worker_id';
baseQuery += ' GROUP BY w.user_id';
return executePagedQuery(baseQuery, countQuery, params, {
page, limit, orderBy: 'w.worker_id', orderDirection: 'DESC'
page, limit, orderBy: 'w.user_id', orderDirection: 'DESC'
});
},
@@ -362,7 +362,7 @@ const optimizedQueries = {
wt.name as work_type_name, wst.name as work_status_name,
et.name as error_type_name, u.name as created_by_name
FROM daily_work_reports dwr
LEFT JOIN workers w ON dwr.worker_id = w.worker_id
LEFT JOIN workers w ON dwr.user_id = w.user_id
LEFT JOIN projects p ON dwr.project_id = p.project_id
LEFT JOIN work_types wt ON dwr.work_type_id = wt.id
LEFT JOIN work_status_types wst ON dwr.work_status_id = wst.id