30 lines
899 B
PHP
30 lines
899 B
PHP
<?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('items', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('item_code')->unique();
|
|
$table->string('item_name');
|
|
$table->enum('category', ['raw_material', 'wip', 'finished_good']);
|
|
$table->string('unit_of_measure');
|
|
$table->decimal('minimum_stock_level', 12, 2)->default(0);
|
|
$table->decimal('cost_price', 12, 2)->default(0);
|
|
$table->text('description')->nullable();
|
|
$table->boolean('is_active')->default(true);
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('items');
|
|
}
|
|
};
|