Merge branch 'develop' of http://114.203.209.83:3000/SamProject/sam-api into develop
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* 선생산 완료 시 재고 입고를 위해 stock_lots에 work_order_id FK 추가
|
||||
* - 구매입고: receiving_id 참조
|
||||
* - 생산입고: work_order_id 참조
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('stock_lots', function (Blueprint $table) {
|
||||
$table->unsignedBigInteger('work_order_id')
|
||||
->nullable()
|
||||
->after('receiving_id')
|
||||
->comment('생산입고 시 작업지시 참조');
|
||||
|
||||
$table->foreign('work_order_id')
|
||||
->references('id')
|
||||
->on('work_orders')
|
||||
->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('stock_lots', function (Blueprint $table) {
|
||||
$table->dropForeign(['work_order_id']);
|
||||
$table->dropColumn('work_order_id');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user