51 lines
1.4 KiB
PHP
51 lines
1.4 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()
|
||
|
|
{
|
||
|
|
Schema::create('staff', function (Blueprint $table) {
|
||
|
|
$table->id();
|
||
|
|
|
||
|
|
// Personal Information
|
||
|
|
$table->string('employee_id')->unique();
|
||
|
|
$table->string('name');
|
||
|
|
$table->string('email')->unique();
|
||
|
|
$table->string('phone');
|
||
|
|
$table->string('emergency_phone')->nullable();
|
||
|
|
$table->text('address')->nullable();
|
||
|
|
|
||
|
|
// Professional Information
|
||
|
|
$table->string('role')->nullable(); // Job title
|
||
|
|
$table->string('department')->nullable();
|
||
|
|
$table->string('designation')->nullable();
|
||
|
|
$table->date('joining_date')->nullable();
|
||
|
|
$table->string('status')->default('active'); // active/inactive
|
||
|
|
$table->text('additional_info')->nullable();
|
||
|
|
|
||
|
|
// System Access
|
||
|
|
$table->string('username')->unique();
|
||
|
|
$table->string('password');
|
||
|
|
|
||
|
|
$table->softDeletes();
|
||
|
|
$table->timestamps();
|
||
|
|
});
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Reverse the migrations.
|
||
|
|
*/
|
||
|
|
public function down(): void
|
||
|
|
{
|
||
|
|
Schema::dropIfExists('staff');
|
||
|
|
}
|
||
|
|
};
|