Add live SQL import for local and staging sync
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user