<?php

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('guidebooks', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->nullable()->constrained('users')->nullOnDelete(); //who write this : auther
            $table->text('image_url')->nullable();
            $table->text('title');
            $table->foreignId('province_id')->nullable()->constrained('provinces')->nullOnDelete();
            $table->text('description')->nullable();
            $table->text('footer')->nullable();
            $table->enum('type',['adventure','wellness','culture','activities','culinary','pilgrimage','education','rural','nature','all'])->default('all');
            $table->enum('season',['summer','winter','rainy','all'])->default('all');
            $table->string('language_code', 2)->nullable();
            $table->boolean('enable_comment')->default(true);

            $table->boolean('is_public')->default(true);
            $table->boolean('status')->default(true);
            $table->timestamps();
        });
    }

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