<?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('pilihan_sekolah', function (Blueprint $table) {
            $table->id();
            $table->foreignId('siswa_id')->constrained('siswa')->onDelete('cascade');
            $table->string('nama_sekolah');
            $table->enum('jenjang', ['sma', 'smk', 'ma', 'perguruan_tinggi', 'lainnya']);
            $table->string('keterangan', 255)->nullable();
            $table->timestamps();

            $table->unique('siswa_id');
        });
    }

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