Add live SQL import for local and staging sync

This commit is contained in:
Dwindi Ramadhana
2026-02-07 13:37:02 +07:00
parent 844ad4901b
commit 3c8f061819
5 changed files with 652 additions and 0 deletions

View File

@@ -2,7 +2,17 @@
use Illuminate\Foundation\Inspiring;
use Illuminate\Support\Facades\Artisan;
use App\Services\LiveSqlImportService;
Artisan::command('inspire', function () {
$this->comment(Inspiring::quote());
})->purpose('Display an inspiring quote');
Artisan::command('dewemoji:import-live-sql {path : Absolute path to dewemojiAPI_DB.sql} {--truncate : Truncate target tables first} {--batch=500 : Insert batch size}', function () {
$path = (string) $this->argument('path');
$truncate = (bool) $this->option('truncate');
$batch = (int) $this->option('batch');
$importer = app(LiveSqlImportService::class);
$importer->import($path, $truncate, $batch, $this->output);
})->purpose('Import live SQL dump into the current database');