<?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('p1_persetujuan_penelitian', function (Blueprint $table) {
            $table->string('nosrt')->primary();
            $table->date('tanggal');
            $table->string('nim');
            $table->string('nama');
            $table->string('jurusan');
            $table->text('alamat');
            $table->string('lokasi_penelitian');
            $table->string('judul');
            $table->timestamps();

            $table->foreign('nim')->references('nim')->on('mahasiswa')->onDelete('cascade');
        });
    }

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