feat: 5130 레거시 마이그레이션 커맨드 및 관련 파일 추가
- Migrate5130Bom: 완제품 BOM 템플릿 마이그레이션 (61건) - Migrate5130Orders: 주문 데이터 마이그레이션 - Migrate5130PriceItems: 품목 데이터 마이그레이션 - Verify5130Calculation: 견적 계산 검증 커맨드 - Legacy5130Calculator: 레거시 계산 헬퍼 - ContractFromBiddingRequest: 입찰→계약 전환 요청 - 마이그레이션: shipments.work_order_id, order_id_mappings 테이블
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('shipments', function (Blueprint $table) {
|
||||
$table->foreignId('work_order_id')
|
||||
->nullable()
|
||||
->after('order_id')
|
||||
->comment('작업지시 ID');
|
||||
|
||||
$table->index(['tenant_id', 'work_order_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('shipments', function (Blueprint $table) {
|
||||
$table->dropIndex(['tenant_id', 'work_order_id']);
|
||||
$table->dropColumn('work_order_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
/**
|
||||
* 5130 output.num → SAM orders.id 매핑 테이블
|
||||
* 마이그레이션 추적 및 롤백을 위해 사용
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('order_id_mappings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->bigInteger('source_num')->unsigned()->comment('5130 output.num');
|
||||
$table->bigInteger('order_id')->unsigned()->comment('SAM orders.id');
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique('source_num');
|
||||
$table->index('order_id');
|
||||
|
||||
$table->foreign('order_id')->references('id')->on('orders')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('order_id_mappings');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user