Files
HRM-System/database/migrations/2025_07_24_104518_create_promotions_table.php
2026-04-13 08:16:56 +08:00

37 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('promotions', function (Blueprint $table) {
$table->id();
$table->foreignId('employee_id')->constrained('users')->onDelete('cascade');
$table->string('previous_designation')->nullable();
$table->foreignId('designation_id')->constrained('designations')->onDelete('cascade');
$table->date('promotion_date');
$table->date('effective_date');
$table->decimal('salary_adjustment', 15, 2)->nullable();
$table->text('reason')->nullable();
$table->string('document')->nullable();
$table->enum('status', ['pending', 'approved', 'rejected'])->default('pending');
$table->foreignId('created_by')->constrained('users')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('promotions');
}
};