41 lines
1.2 KiB
PHP
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');
|
|
}
|
|
};
|