<?php

use App\Enums\DbStatusFieldEnum;
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('product_groups', function (Blueprint $table) {
            $table->id();
            // $table->string('productNo')->nullable(); //cikkszám (eladói nincs mivel több is lehet)
            $table->string('name')->nullable();
            $table->enum('type', \App\Enums\ProductTypeEnum::getKeys())->nullable();
            $table->enum('status', DbStatusFieldEnum::getValues())->default(DbStatusFieldEnum::draft);
            $table->boolean('canSee')->default(true);
            $table->timestamps();
            $table->softDeletes();
            $table->nestedSet();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('product_groups');
    }
};
