TK-FB(공장관리+신고)와 M-Project(부적합관리)를 3개 독립 시스템으로 분리하기 위한 전체 코드 구조 작성. - SSO 인증 서비스 (bcrypt + pbkdf2 이중 해시 지원) - System 1: 공장관리 (TK-FB 기반, 신고 코드 제거) - System 2: 신고 (TK-FB에서 workIssue 코드 추출) - System 3: 부적합관리 (M-Project 기반) - Gateway 포털 (path-based 라우팅) - 통합 docker-compose.yml 및 배포 스크립트 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
/**
|
|
* 작업 테이블 생성 (공정=work_types에 속함)
|
|
*
|
|
* @param {import('knex').Knex} knex
|
|
*/
|
|
exports.up = function(knex) {
|
|
return knex.schema.createTable('tasks', function(table) {
|
|
table.increments('task_id').primary().comment('작업 ID');
|
|
table.integer('work_type_id').nullable().comment('공정 ID (work_types 참조)');
|
|
table.string('task_name', 255).notNullable().comment('작업명');
|
|
table.text('description').nullable().comment('작업 설명');
|
|
table.boolean('is_active').defaultTo(true).comment('활성화 여부');
|
|
table.timestamp('created_at').defaultTo(knex.fn.now()).comment('생성일시');
|
|
table.timestamp('updated_at').defaultTo(knex.fn.now()).comment('수정일시');
|
|
|
|
// 외래키 (work_types 테이블 참조)
|
|
table.foreign('work_type_id')
|
|
.references('id')
|
|
.inTable('work_types')
|
|
.onDelete('SET NULL')
|
|
.onUpdate('CASCADE');
|
|
|
|
// 인덱스
|
|
table.index('work_type_id');
|
|
table.index('is_active');
|
|
}).then(() => {
|
|
console.log('✅ tasks 테이블 생성 완료');
|
|
});
|
|
};
|
|
|
|
/**
|
|
* @param {import('knex').Knex} knex
|
|
*/
|
|
exports.down = function(knex) {
|
|
return knex.schema.dropTableIfExists('tasks');
|
|
};
|