feat: 권한 탭 분리 + 부서 인원 표시 + 다수 시스템 개선
- tkuser: 권한 관리를 별도 탭으로 분리, 부서 클릭 시 소속 인원 목록 표시 - system1: 모바일 UI 개선, nginx 권한 보정, 신고 카테고리 타입 마이그레이션 - system2: 신고 상세/보고서 개선, 내 보고서 페이지 추가 - system3: 이슈 뷰/수신함/관리함 개선 - gateway: 포털 라우팅 수정 - user-management API: 부서별 권한 벌크 설정 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* 마이그레이션: work_issue_reports에 category_type 컬럼 추가
|
||||
* - issue_report_categories ENUM에 'facility' 추가
|
||||
* - work_issue_reports에 category_type 직접 저장 (유형 이관 기능 지원)
|
||||
* - 기존 데이터 백필
|
||||
*/
|
||||
|
||||
exports.up = async function(knex) {
|
||||
// 1) issue_report_categories ENUM에 'facility' 추가
|
||||
await knex.raw(`
|
||||
ALTER TABLE issue_report_categories
|
||||
MODIFY COLUMN category_type ENUM('nonconformity', 'safety', 'facility') NOT NULL
|
||||
`);
|
||||
|
||||
// 2) work_issue_reports에 category_type 컬럼 추가
|
||||
await knex.raw(`
|
||||
ALTER TABLE work_issue_reports
|
||||
ADD COLUMN category_type ENUM('nonconformity', 'safety', 'facility') NULL AFTER issue_item_id
|
||||
`);
|
||||
|
||||
// 3) 기존 데이터 백필: issue_report_categories에서 category_type 복사
|
||||
await knex.raw(`
|
||||
UPDATE work_issue_reports wir
|
||||
INNER JOIN issue_report_categories irc ON wir.issue_category_id = irc.category_id
|
||||
SET wir.category_type = irc.category_type
|
||||
`);
|
||||
|
||||
// 4) NOT NULL로 변경
|
||||
await knex.raw(`
|
||||
ALTER TABLE work_issue_reports
|
||||
MODIFY COLUMN category_type ENUM('nonconformity', 'safety', 'facility') NOT NULL
|
||||
`);
|
||||
|
||||
// 5) 인덱스 추가
|
||||
await knex.raw(`
|
||||
ALTER TABLE work_issue_reports ADD INDEX idx_wir_category_type (category_type)
|
||||
`);
|
||||
|
||||
console.log('work_issue_reports에 category_type 컬럼 추가 완료');
|
||||
};
|
||||
|
||||
exports.down = async function(knex) {
|
||||
await knex.raw(`ALTER TABLE work_issue_reports DROP INDEX idx_wir_category_type`);
|
||||
await knex.raw(`ALTER TABLE work_issue_reports DROP COLUMN category_type`);
|
||||
await knex.raw(`
|
||||
ALTER TABLE issue_report_categories
|
||||
MODIFY COLUMN category_type ENUM('nonconformity', 'safety') NOT NULL
|
||||
`);
|
||||
|
||||
console.log('work_issue_reports에서 category_type 컬럼 제거 완료');
|
||||
};
|
||||
Reference in New Issue
Block a user