Remove activity log migration files and update FillJsonData seeder to include ActionEventsMigrator. Clean up LoanOrdersMigrator comments for clarity.
This commit is contained in:
26
database/seeders/Migrators/ActionEventsMigrator.php
Normal file
26
database/seeders/Migrators/ActionEventsMigrator.php
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user