<?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('amenities', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('property_id');

            $table->boolean('gym')->default(false);
            $table->boolean('spa')->default(false);
            $table->boolean('security_24x7')->default(false);
            $table->boolean('premium_lifts')->default(false);
            $table->boolean('cctv_surveillance')->default(false);
            $table->boolean('club_house')->default(false);
            $table->boolean('mivan_construction')->default(false);
            $table->boolean('jogging_track')->default(false);
            $table->boolean('rainwater_harvesting')->default(false);
            $table->boolean('power_backup')->default(false);
            $table->boolean('water_supply_24x7')->default(false);
            $table->boolean('swimming_area')->default(false);
            $table->boolean('kids_play_area')->default(false);
            $table->boolean('yoga_area')->default(false);
            $table->boolean('barbeque_area')->default(false);
            $table->boolean('co_working_space')->default(false);
            $table->boolean('ultra_luxury')->default(false);
            $table->boolean('gated_secured_homes')->default(false);
            $table->boolean('basketball_court')->default(false);
            $table->boolean('badminton_court')->default(false);
            $table->boolean('table_tennis')->default(false);
            $table->boolean('tennis_court')->default(false);
            $table->boolean('restaurant_bar')->default(false);
            $table->boolean('meditation_area')->default(false);
            $table->boolean('spacious_parking')->default(false);
            $table->boolean('multipurpose_hall')->default(false);
            $table->boolean('fire_protection')->default(false);
            $table->boolean('library')->default(false);
            $table->boolean('mini_theatre')->default(false);

            $table->timestamps();

            $table->foreign('property_id')->references('id')->on('properties')->onDelete('cascade');
        });
    }

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