<?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('riwayat_rekomendasis', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id')->constrained('users')->cascadeOnDelete();

            $table->float('agama');
            $table->float('pkn');
            $table->float('bahasa_indonesia');
            $table->float('bahasa_inggris');
            $table->float('matematika');
            $table->float('fisika');
            $table->float('kimia');
            $table->float('biologi');
            $table->float('sejarah');
            $table->float('geografi');
            $table->float('ekonomi_mapel');
            $table->float('sosiologi');
            $table->float('seni_budaya');
            $table->float('pjok');
            $table->float('informatika');

            $table->float('riasec_r')->default(0);
            $table->float('riasec_i')->default(0);
            $table->float('riasec_a')->default(0);
            $table->float('riasec_s')->default(0);
            $table->float('riasec_e')->default(0);
            $table->float('riasec_c')->default(0);

            $table->bigInteger('gaji_ortu');
            $table->string('hasil_rekomendasi_jurusan')->nullable();

            $table->timestamps();
        });
    }

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