mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-09 12:42:36 +01:00
Update export migrations
This commit is contained in:
parent
b02bf18989
commit
37c7ec4265
@ -17,7 +17,7 @@ class ExportMigrations extends Command
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'migrations:export {--user=} {--random=}';
|
||||
protected $signature = 'migrations:export {--user=} {--email=} {--random=}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
@ -46,8 +46,36 @@ class ExportMigrations extends Command
|
||||
$this->info('Note: Migrations will be stored inside of (storage/migrations) folder.');
|
||||
|
||||
if($this->option('user')) {
|
||||
$record = User::findOrFail($this->option('user'));
|
||||
return $this->export($record);
|
||||
$record = User::on(DB_NINJA_1)->find($this->option('user'));
|
||||
|
||||
if($record)
|
||||
return $this->export($record);
|
||||
|
||||
$record = User::on(DB_NINJA_2)->find($this->option('user'));
|
||||
|
||||
if($record)
|
||||
return $this->export($record);
|
||||
|
||||
|
||||
$this->info('I could not find that user - sorry');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if($this->option('email')) {
|
||||
$record = User::on(DB_NINJA_1)->where('email', $this->option('user'))->first();
|
||||
|
||||
if($record)
|
||||
return $this->export($record);
|
||||
|
||||
$record = User::on(DB_NINJA_2)->where('email', $this->option('user'))->first();
|
||||
|
||||
if($record)
|
||||
return $this->export($record);
|
||||
|
||||
|
||||
$this->info('I could not find that user by email - sorry');
|
||||
return;
|
||||
}
|
||||
|
||||
if($this->option('random')){
|
||||
|
Loading…
Reference in New Issue
Block a user