fix: exclude deleted records when fetching companies from legacy database

This commit is contained in:
Yoga Pangestu 2026-04-13 10:33:03 +07:00
parent 15c76645e4
commit 535fe76197

View File

@ -37,7 +37,9 @@ public function handle()
$this->info('Starting company migration...');
$legacyConn = DB::connection('mysql_second');
$legacyCompanies = $legacyConn->table('companies')->get();
$legacyCompanies = $legacyConn->table('companies')
->whereNull('deleted_at')
->get();
if ($legacyCompanies->isEmpty()) {
$this->warn('No companies found in legacy database.');