pintu2/database/migrations/2024_01_31_051425_create_mahasiswas_table.php

46 lines
1.6 KiB
PHP
Raw Permalink Normal View History

2024-02-27 22:53:57 +07:00
<?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(): void
{
Schema::create('mahasiswas', function (Blueprint $table) {
$table->id();
$table->string('nim');
$table->string('nama');
$table->string('email');
$table->string('nomor_hp');
$table->string('bagian');
$table->string('judul_seminar_proposal');
$table->string('judul_skripsi_id');
$table->string('judul_skripsi_en');
$table->string('judul_jurnal');
$table->string('judul_artikel');
$table->unsignedBigInteger('dosen_dpu_id');
$table->unsignedBigInteger('dosen_dpa_id');
$table->unsignedBigInteger('dosen_penguji1_id');
$table->unsignedBigInteger('dosen_penguji2_id');
$table->foreign('dosen_dpu_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('dosen_dpa_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('dosen_penguji1_id')->references('id')->on('users')->onDelete('cascade');
$table->foreign('dosen_penguji2_id')->references('id')->on('users')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('mahasiswas');
}
};