Files
jouwdriedee/database/migrations/2026_10_31_121207_create_materials_table.php
2026-10-31 13:24:24 +01:00

28 lines
877 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('materials', function (Blueprint $table) {
$table->id();
$table->string('name'); // bv. PLA+, PETG, TPU Flex, ABS
$table->string('code')->unique(); // pla, petg, tpu
$table->text('description')->nullable();
$table->string('badge_color')->default('emerald'); // emerald, blue, purple, amber
$table->decimal('price_multiplier', 4, 2)->default(1.00); // bv. 1.00, 1.25, 1.40
$table->boolean('is_active')->default(true);
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('materials');
}
};