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

33 lines
894 B
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('designations', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->text('description')->nullable();
$table->foreignId('department_id')->constrained('departments')->onDelete('cascade');
$table->enum('status', ['active', 'inactive'])->default('active');
$table->foreignId('created_by')->constrained('users')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('designations');
}
};