<?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('ph_sub_districts', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('sub_district_id');
            $table->double('meter_0_5');
            $table->double('meter_5_15');
            $table->double('meter_15_30');
            $table->double('meter_30_60');
            $table->double('meter_60_100');
            $table->double('meter_100_200');
            $table->timestamps();
        });

        schema::table('ph_sub_districts', function (Blueprint $table) {
            $table->foreign('sub_district_id')->references('id')->on('sub_district');
        });
    }

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