<?php

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

return new class extends Migration
{
    public function up(): void
    {
        Schema::create('wisatas', function (Blueprint $table): void {
            $table->id();
            $table->foreignId('kategori_id')->constrained('kategoris')->cascadeOnUpdate()->restrictOnDelete();
            $table->string('title');
            $table->string('slug')->unique();
            $table->string('location');
            $table->string('image')->nullable();
            $table->decimal('rating', 2, 1)->default(0);
            $table->string('distance')->nullable();
            $table->string('elevation')->nullable();
            $table->string('tiket_parkir')->nullable();
            $table->string('jam_operasional')->nullable();
            $table->text('short_description')->nullable();
            $table->longText('overview')->nullable();
            $table->string('model_path')->nullable();
            $table->string('video_path')->nullable();
            $table->boolean('is_video')->default(false);
            $table->decimal('latitude', 10, 7)->nullable();
            $table->decimal('longitude', 10, 7)->nullable();
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('wisatas');
    }
};
