- 순찰/점검 기능 개선 (zone-detail 페이지 추가) - 출근/근태 시스템 개선 (연차 조회, 근무현황) - 작업분석 대분류 그룹화 및 마이그레이션 스크립트 - 모바일 네비게이션 UI 추가 - NAS 배포 도구 및 문서 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
/**
|
|
* 작업장(작업 구역) 테이블 생성 마이그레이션
|
|
* 소분류: 서스작업장, 조립구역 등
|
|
*/
|
|
|
|
exports.up = function(knex) {
|
|
return knex.schema.createTable('workplaces', function(table) {
|
|
table.increments('workplace_id').primary().comment('작업장 ID');
|
|
table.integer('category_id').unsigned().nullable().comment('카테고리 ID (공장)');
|
|
table.string('workplace_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('수정일시');
|
|
|
|
// 외래키
|
|
table.foreign('category_id')
|
|
.references('category_id')
|
|
.inTable('workplace_categories')
|
|
.onDelete('SET NULL')
|
|
.onUpdate('CASCADE');
|
|
|
|
// 인덱스
|
|
table.index('category_id');
|
|
table.index('is_active');
|
|
});
|
|
};
|
|
|
|
exports.down = function(knex) {
|
|
return knex.schema.dropTableIfExists('workplaces');
|
|
};
|