Refactor ActivityLogModule and clean up seeders
- Adjusted indentation in ActivityLogModule methods for consistency. - Simplified ActivityLogRepository class by removing unnecessary lines. - Updated FillJsonData seeder to streamline the run method. - Modified various Migrator classes to change JSON data paths for testing and added sequence reset statements for better database integrity.
This commit is contained in:
@@ -3,7 +3,6 @@
|
||||
namespace Database\Seeders\Migrators;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use JsonMachine\Items;
|
||||
|
||||
class LoanOrdersMigrator
|
||||
@@ -12,7 +11,7 @@ class LoanOrdersMigrator
|
||||
{
|
||||
DB::table('loan_orders')->truncate();
|
||||
|
||||
$path = database_path('data/nurmuhammetsdb/loan_orders.json');
|
||||
$path = database_path('data/tested/loan_orders.json');
|
||||
|
||||
$items = Items::fromFile($path);
|
||||
|
||||
@@ -23,5 +22,8 @@ class LoanOrdersMigrator
|
||||
|
||||
DB::table('loan_orders')->insert((array) $item);
|
||||
}
|
||||
|
||||
DB::statement("SELECT setval('loan_orders_id_seq', (SELECT MAX(id) from loan_orders));");
|
||||
DB::statement("SELECT nextval('loan_orders_id_seq');");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user