32 lines
939 B
PHP
32 lines
939 B
PHP
<?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('members', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('no_anggota')->nullable()->index();
|
|
$table->string('no_pekerja')->nullable()->unique();
|
|
$table->string('no_kp')->nullable()->unique();
|
|
$table->string('nama')->index();
|
|
$table->string('jabatan')->nullable();
|
|
$table->string('bahagian')->nullable();
|
|
$table->string('telefon')->nullable();
|
|
$table->boolean('status_aktif')->default(true);
|
|
$table->timestamps();
|
|
|
|
$table->index(['jabatan', 'bahagian']);
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('members');
|
|
}
|
|
};
|