feat: add log_type column to request_logs table
This commit is contained in:
@@ -57,6 +57,7 @@ class RequestLog extends Model
|
||||
'type_of_member',
|
||||
'nominal',
|
||||
'approval_nominal_by',
|
||||
'log_type',
|
||||
];
|
||||
|
||||
protected $hidden = [
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user