43 lines
1.5 KiB
PHP
43 lines
1.5 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('onboardings', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('user_id')->nullable()->constrained('users')->onDelete('set null');
|
|
$table->string('name');
|
|
$table->string('email');
|
|
$table->string('type')->default('intern'); // intern, candidate, employee
|
|
$table->string('status')->default('preboarding'); // preboarding, active, offboarding, offboarded
|
|
$table->date('join_date')->nullable();
|
|
$table->date('exit_date')->nullable();
|
|
$table->string('department')->nullable();
|
|
$table->json('assigned_roles')->nullable();
|
|
$table->json('assigned_apps')->nullable();
|
|
$table->json('checklist')->nullable();
|
|
$table->text('notes')->nullable();
|
|
$table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null');
|
|
$table->foreignId('offboarded_by')->nullable()->constrained('users')->onDelete('set null');
|
|
$table->timestamp('offboarded_at')->nullable();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('onboardings');
|
|
}
|
|
};
|