mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 13:44:35 -04:00
Minor fixes for bulk import
This commit is contained in:
parent
a8f186c921
commit
77929a6bc3
@ -88,14 +88,15 @@ class ImportMigrations extends Command
|
|||||||
'confirmation_code' => $this->createDbHash(config('database.default')),
|
'confirmation_code' => $this->createDbHash(config('database.default')),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
CompanyToken::unguard();
|
||||||
$company_token = CompanyToken::create([
|
$company_token = CompanyToken::create([
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'company_id' => $company->id,
|
'company_id' => $company->id,
|
||||||
'account_id' => $account->id,
|
'account_id' => $account->id,
|
||||||
'name' => 'test token',
|
'name' => 'First token',
|
||||||
'token' => Str::random(64),
|
'token' => Str::random(64),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$user->companies()->attach($company->id, [
|
$user->companies()->attach($company->id, [
|
||||||
'account_id' => $account->id,
|
'account_id' => $account->id,
|
||||||
'is_owner' => 1,
|
'is_owner' => 1,
|
||||||
|
@ -107,7 +107,7 @@ class StartMigration implements ShouldQueue
|
|||||||
|
|
||||||
$data = json_decode(file_get_contents($file), 1);
|
$data = json_decode(file_get_contents($file), 1);
|
||||||
|
|
||||||
Import::dispatchNow($data['data'], $this->company, $this->user);
|
Import::dispatchNow($data, $this->company, $this->user);
|
||||||
} catch (NonExistingMigrationFile | ProcessingMigrationArchiveFailed | ResourceNotAvailableForMigration | MigrationValidatorFailed | ResourceDependencyMissing $e) {
|
} catch (NonExistingMigrationFile | ProcessingMigrationArchiveFailed | ResourceNotAvailableForMigration | MigrationValidatorFailed | ResourceDependencyMissing $e) {
|
||||||
|
|
||||||
Mail::to($this->user)->send(new MigrationFailed($e, $e->getMessage()));
|
Mail::to($this->user)->send(new MigrationFailed($e, $e->getMessage()));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user