Fix rowmapper generator, check for fields, map users #443 (#583)

* 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:
Nabeel S
2020-02-23 19:48:28 -05:00
committed by GitHub
parent a1d6fa17ad
commit dfbaa1afd3
17 changed files with 214 additions and 49 deletions

View File

@@ -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) {