sistem-akademik/database/migrations/2025_04_10_000426_create_students_table.php
2025-04-11 22:56:42 +07:00

41 lines
1.2 KiB
PHP

<?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('students', function (Blueprint $table) {
$table->id();
$table->string('full_name');
$table->string('nis')->unique()->nullable();
$table->string('nisn')->unique()->nullable();
$table->enum('gender', ['L', 'P']);
$table->date('birth_date')->nullable();
$table->string('birth_place')->nullable();
$table->text('address')->nullable();
$table->text('religion')->nullable();
$table->string('phone')->nullable();
$table->string('email')->nullable();
$table->foreignId('class_id')->nullable()->constrained('class_rooms');
$table->string('parent_name')->nullable();
$table->string('parent_phone')->nullable();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('students');
}
};