<?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('height_village', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('village_id');
            $table->double('height');
            $table->string('year');
            $table->timestamps();
        });

        schema::table('height_village', function (Blueprint $table) {
            $table->foreign('village_id')->references('id')->on('village');
        });
    }

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