41 lines
1.2 KiB
PHP
41 lines
1.2 KiB
PHP
<?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::create('hardwares', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name');
|
|
$table->string('type');
|
|
$table->string('brand');
|
|
$table->string('model');
|
|
$table->string('serial_number')->unique();
|
|
$table->string('status')->default('en_stock'); // en_stock, en_service, en_panne, au_rebut
|
|
$table->date('purchase_date')->nullable();
|
|
$table->date('commissioning_date')->nullable();
|
|
$table->date('warranty_expiration_date')->nullable();
|
|
$table->string('location');
|
|
$table->string('ip_address')->nullable();
|
|
$table->foreignId('order_id')->nullable()->constrained('orders')->nullOnDelete();
|
|
$table->text('notes')->nullable();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('hardwares');
|
|
}
|
|
};
|