<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\DB;

class CreateCategoriesDocsUtilesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('categories_docs_utiles', function (Blueprint $table) {
            $table->id();
            $table->string('nom');
            $table->string('slug');
            $table->unsignedBigInteger('user_matricule');
            $table->enum('statut', ['PUBLISHED', 'PENDING', 'BLOCKED', 'SIGNALED', 'DELETED'])->default('PUBLISHED');
            $table->dateTime('created_at')->default(DB::raw('CURRENT_TIMESTAMP'));
            $table->dateTime('updated_at')->default(DB::raw('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'));
        });
    }

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