fix: [production] 자재투입 bom_group_key 개별 저장 — 동일 자재 다중 BOM 그룹 지원
- bom_group_key 컬럼 추가 마이그레이션 (work_order_material_inputs) - WorkOrderMaterialInput 모델 fillable에 bom_group_key 추가 - MaterialInputForItemRequest에 bom_group_key 검증 + replace 옵션 추가 - WorkOrderService.getMaterialsForItem: stock_lot_id+bom_group_key 복합키 기투입 조회 (하위호환) - WorkOrderService.registerMaterialInputForItem: bom_group_key 저장 + replace 모드 (기존 삭제→재등록) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('work_order_material_inputs', function (Blueprint $table) {
|
||||
$table->string('bom_group_key')->nullable()->after('item_id')
|
||||
->comment('BOM 그룹키 (같은 item_id의 다른 용도 구분, ex: itemId_category_partType)');
|
||||
|
||||
$table->index(['work_order_item_id', 'bom_group_key'], 'idx_womi_item_bomgroup');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('work_order_material_inputs', function (Blueprint $table) {
|
||||
$table->dropIndex('idx_womi_item_bomgroup');
|
||||
$table->dropColumn('bom_group_key');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user