* Fix rowmapper generator, check for fields, map users #443 * Formatting * Remove value store at the end of the import * Update the notes for the importer about users * Uncomment importers disabled during testing
This commit is contained in:
@@ -8,6 +8,7 @@ use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Modules\Importer\Utils\IdMapper;
|
||||
use Modules\Importer\Utils\ImporterDB;
|
||||
|
||||
@@ -27,7 +28,7 @@ abstract class BaseImporter implements ShouldQueue
|
||||
/**
|
||||
* The mapper class used for old IDs to new IDs
|
||||
*
|
||||
* @var \Illuminate\Contracts\Foundation\Application|mixed
|
||||
* @var IdMapper
|
||||
*/
|
||||
protected $idMapper;
|
||||
|
||||
@@ -38,6 +39,13 @@ abstract class BaseImporter implements ShouldQueue
|
||||
*/
|
||||
protected $table;
|
||||
|
||||
/**
|
||||
* The column used for the ID, used for the ORDER BY
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $idField = 'id';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$importerService = app(ImporterService::class);
|
||||
@@ -66,6 +74,8 @@ abstract class BaseImporter implements ShouldQueue
|
||||
|
||||
$start = 0;
|
||||
$total_rows = $this->db->getTotalRows($this->table);
|
||||
Log::info('Found '.$total_rows.' rows for '.$this->table);
|
||||
|
||||
do {
|
||||
$end = $start + $this->db->batchSize;
|
||||
if ($end > $total_rows) {
|
||||
|
||||
Reference in New Issue
Block a user