<?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 {
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up(){
        Schema::create((new Status)->getTable(), function (Blueprint $table) {
            $table->string("code",100)->primary();
            $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->unsignedBigInteger('position')
                 ->nullable()
                ->comment("La position (Ex:'3')");

            $table->string("model",60)
                ->nullable()
                ->comment("Le model concerné (ex: 'order')");

            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down(){
        Schema::dropIfExists((new Status)->getTable());
    }
};
