feat: 다수 기능 개선 - 순찰, 출근, 작업분석, 모바일 UI 등
- 순찰/점검 기능 개선 (zone-detail 페이지 추가) - 출근/근태 시스템 개선 (연차 조회, 근무현황) - 작업분석 대분류 그룹화 및 마이그레이션 스크립트 - 모바일 네비게이션 UI 추가 - NAS 배포 도구 및 문서 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
/**
|
||||
* @param { import("knex").Knex } knex
|
||||
* @returns { Promise<void> }
|
||||
*/
|
||||
exports.up = function(knex) {
|
||||
const schemaSql = fs.readFileSync(path.join(__dirname, '../../hyungi_schema_v2.sql'), 'utf8');
|
||||
return knex.raw(schemaSql);
|
||||
};
|
||||
|
||||
/**
|
||||
* @param { import("knex").Knex } knex
|
||||
* @returns { Promise<void> }
|
||||
*/
|
||||
exports.down = function(knex) {
|
||||
// down 마이그레이션은 모든 테이블을 역순으로 삭제하도록 구현합니다.
|
||||
const tables = [
|
||||
'cutting_plans',
|
||||
'daily_issue_reports',
|
||||
'daily_work_reports',
|
||||
'codes',
|
||||
'code_types',
|
||||
'factory_info',
|
||||
'equipment_list',
|
||||
'pipe_specs',
|
||||
'tasks',
|
||||
'worker_groups',
|
||||
'workers',
|
||||
'projects',
|
||||
'password_change_logs',
|
||||
'login_logs',
|
||||
'users'
|
||||
];
|
||||
|
||||
// 외래 키 제약 조건을 먼저 비활성화합니다.
|
||||
return knex.raw('SET FOREIGN_KEY_CHECKS = 0;')
|
||||
.then(() => {
|
||||
// 각 테이블을 순회하며 drop table if exists를 실행합니다.
|
||||
return tables.reduce((promise, tableName) => {
|
||||
return promise.then(() => knex.schema.dropTableIfExists(tableName));
|
||||
}, Promise.resolve());
|
||||
})
|
||||
.finally(() => {
|
||||
// 외래 키 제약 조건을 다시 활성화합니다.
|
||||
return knex.raw('SET FOREIGN_KEY_CHECKS = 1;');
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user