<?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('p2_sk_pembimbing', function (Blueprint $table) {
            $table->string('nosrt')->primary();
            $table->string('nim_mahasiswa');
            $table->string('program_studi');
            $table->text('judul_skripsi');
            $table->string('nip_dosen_pembimbing1');
            $table->string('nip_dosen_pembimbing2');
            $table->timestamps();

            $table->foreign('nim_mahasiswa')->references('nim')->on('mahasiswa')->onDelete('cascade');
            $table->foreign('nip_dosen_pembimbing1')->references('nip')->on('dosen')->onDelete('cascade');
            $table->foreign('nip_dosen_pembimbing2')->references('nip')->on('dosen')->onDelete('cascade');
        });
    }

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