commit13
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<?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::create('warehouse_requests', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('tenant_id')->constrained()->restrictOnDelete();
|
||||
$table->foreignId('created_by')->constrained('users')->restrictOnDelete();
|
||||
$table->foreignId('warehouse_id')->constrained()->restrictOnDelete();
|
||||
$table->foreignId('cost_center_id')->constrained()->restrictOnDelete();
|
||||
$table->string('work_context_key')->default('procurement.internal');
|
||||
$table->uuid('operation_key');
|
||||
$table->string('input_hash', 64);
|
||||
$table->string('status')->default('draft');
|
||||
$table->json('snapshot');
|
||||
$table->timestampTz('created_at');
|
||||
$table->unique(['tenant_id', 'created_by', 'operation_key']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('warehouse_requests');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user