feat: add log_type column to request_logs table

This commit is contained in:
Iqbal
2026-05-05 13:43:35 +07:00
parent f42266258f
commit c32e0dd779
2 changed files with 37 additions and 0 deletions

View File

@@ -57,6 +57,7 @@ class RequestLog extends Model
'type_of_member',
'nominal',
'approval_nominal_by',
'log_type',
];
protected $hidden = [

View File

@@ -0,0 +1,36 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if(!Schema::hasColumn('request_logs', 'log_type')) {
Schema::table('request_logs', function (Blueprint $table) {
$table->enum('log_type', ['reference', 'prescription', 'consultation'])->after('dppj')->nullable()->comment('Type of LOG: reference, prescription, or consultation');
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
if(Schema::hasColumn('request_logs', 'log_type')) {
Schema::table('request_logs', function (Blueprint $table) {
$table->dropColumn('log_type');
});
}
}
};