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

36 lines
1.1 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('awards', function (Blueprint $table) {
$table->id();
$table->foreignId('employee_id')->constrained('users')->onDelete('cascade');
$table->foreignId('award_type_id')->constrained('award_types')->onDelete('cascade');
$table->date('award_date');
$table->string('gift')->nullable();
$table->decimal('monetary_value', 15, 2)->nullable();
$table->text('description')->nullable();
$table->string('certificate')->nullable();
$table->string('photo')->nullable();
$table->foreignId('created_by')->constrained('users')->onDelete('cascade');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('awards');
}
};