<?php

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

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('boarding_houses', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained('users')->cascadeOnDelete(); // Relasi ke Pemilik Kos
            $table->string('name');
            $table->enum('type', ['putra', 'putri', 'campur']);
            $table->text('address');
            $table->string('city');
            $table->string('map_link')->nullable();
            $table->longText('description')->nullable();
            $table->text('rules')->nullable();
            $table->enum('status', ['draft', 'pending', 'published'])->default('pending');
            $table->timestamps();
        });
    }

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