feat: 統一進貨單 UI、修復庫存異動紀錄與廠商詳情顯示報錯
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
// Update old statuses to 'approved'
|
||||
DB::table('purchase_orders')
|
||||
->whereIn('status', ['processing', 'shipping', 'confirming'])
|
||||
->update(['status' => 'approved']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
// Cannot easily reverse without knowing original status,
|
||||
// but typically we can revert 'approved' back to 'processing' as a safeguard if needed,
|
||||
// or just leave it since 'approved' is broader.
|
||||
// For strict reversal, we might try to map back, but effectively this is a one-way consolidation.
|
||||
// We will leave it as is for down/safe side.
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user