<?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('parts', function (Blueprint $table) {
$table->id();
$table->string('name', 100);
$table->string('article_number', 50)->unique();
$table->text('description')->nullable();
$table->decimal('purchase_price', 10, 2);
$table->decimal('selling_price', 10, 2);
$table->integer('stock_quantity')->default(0);
$table->integer('min_stock_quantity')->default(5);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('parts');
}
};