<?php

use App\Database\Blueprint;
use App\Enums\DbStatusFieldEnum;
use Illuminate\Database\Migrations\Migration;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('producers', function (Blueprint $table) {
            $table->id();
            $table->string('name')->nullable();
            $table->text('note')->nullable();
            $table->enum('status', DbStatusFieldEnum::getValues())->default(DbStatusFieldEnum::draft);
            $table->boolean('canSee')->default(true);
            $table->unique('id', 'name');
            $table->index('name');
            $table->timestamps();
            $table->softDeletes();
            $table->userIdFields();
        });
    }

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