<?php

use App\Models\SettingManagement\Status;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {

    public function up(){
        Schema::create( (new Status)->getTable(), function (Blueprint $table) {
            $table->string('code',100)->primary()
                ->comment("[PK] Le code du statut");

            $table->string('name')
                ->comment("Le nom (Ex:'Activé')");

            $table->string('color') ->nullable()
                ->comment("La couleur (Ex: '#FFCC22')");

            $table->string('icon')->nullable()
                ->comment("L'icone' (Ex: 'fa fa-lock')");

            $table->json("style") ->nullable()
                ->comment("Le model concerné (ex: 'project')");
            $table->timestamps();
            $table->softDeletes();
        });


    }


    public function down(){
        Schema::dropIfExists((new Status)->getTable());
    }
};
