Added created_by and updated_by fields to MfmReading model and migration #550

Merged
jothi merged 1 commits from ranjith-dev into master 2026-04-29 05:12:17 +00:00
2 changed files with 40 additions and 0 deletions

View File

@@ -40,6 +40,8 @@ class MfmReading extends Model
'power_factor_total',
'created_at',
'updated_at',
'created_by',
'updated_by',
];
public function plant(): BelongsTo

View File

@@ -0,0 +1,38 @@
<?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
{
$sql1 = <<<'SQL'
ALTER TABLE mfm_readings
ADD COLUMN created_by TEXT DEFAULT NULL
SQL;
DB::statement($sql1);
$sql2 = <<<'SQL'
ALTER TABLE mfm_readings
ADD COLUMN updated_by TEXT DEFAULT NULL
SQL;
DB::statement($sql2);
}
/**
* Reverse the migrations.
*/
public function down(): void
{
// Schema::table('mfm_readings', function (Blueprint $table) {
// //
// });
}
};