<?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()
{
Schema::create('data_latih', function (Blueprint $table) {
            $table->id();
            $table->string('kecamatan');
            $table->integer('data_tahun')->nullable(); // sesuai: $row[2]
            $table->float('phbs');                     // sesuai: $row[3]
            $table->float('imunisasi');                // sesuai: $row[4]
            $table->float('merokok');                  // sesuai: $row[5]
            $table->integer('kasus_2023');             // sesuai: $row[6]
            $table->decimal('latitude', 10, 7);        // sesuai: $row[7] / 1000000
            $table->decimal('longitude', 10, 7);       // sesuai: $row[8] / 1000000
            $table->integer('prediksi_tahun')->nullable(); // sesuai: $row[9]
            $table->string('hipotesis')->nullable();        // sesuai: $row[10]
            $table->timestamps(); // created_at & updated_at
        });
}

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