Remove activity log migration files and update FillJsonData seeder to include ActionEventsMigrator. Clean up LoanOrdersMigrator comments for clarity.

This commit is contained in:
Mekan1206
2025-12-21 18:57:21 +05:00
parent a9c7ec6b80
commit 515731003c
10 changed files with 156 additions and 74 deletions

View File

@@ -0,0 +1,26 @@
<?php
namespace Database\Seeders\Migrators;
use Illuminate\Support\Facades\DB;
use JsonMachine\Items;
class ActionEventsMigrator
{
public function migrate(): void
{
DB::table('action_events')->truncate();
$path = database_path('data/tested/action_events.json');
$items = Items::fromFile($path);
foreach ($items as $id => $item) {
if (! $item) {
continue;
}
DB::table('action_events')->insert((array) $item);
}
}
}

View File

@@ -10,8 +10,6 @@ class LoanOrdersMigrator
{
public function migrate(): void
{
// Running on seeder file, may not work.
DB::table('loan_orders')->truncate();
$path = database_path('data/nurmuhammetsdb/loan_orders.json');