mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Update export migrations
This commit is contained in:
parent
b02bf18989
commit
37c7ec4265
@ -17,7 +17,7 @@ class ExportMigrations extends Command
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'migrations:export {--user=} {--random=}';
|
protected $signature = 'migrations:export {--user=} {--email=} {--random=}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
@ -46,8 +46,36 @@ class ExportMigrations extends Command
|
|||||||
$this->info('Note: Migrations will be stored inside of (storage/migrations) folder.');
|
$this->info('Note: Migrations will be stored inside of (storage/migrations) folder.');
|
||||||
|
|
||||||
if($this->option('user')) {
|
if($this->option('user')) {
|
||||||
$record = User::findOrFail($this->option('user'));
|
$record = User::on(DB_NINJA_1)->find($this->option('user'));
|
||||||
return $this->export($record);
|
|
||||||
|
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')){
|
if($this->option('random')){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user