mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
[V1] Update 'migrations:export' message (#3470)
* Update command message * Export migrations command improvements
This commit is contained in:
parent
d9a3b5453a
commit
3f25b62ab6
@ -17,14 +17,14 @@ class ExportMigrations extends Command
|
|||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $signature = 'migrations:export';
|
protected $signature = 'migrations:export {--user=}';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The console command description.
|
* The console command description.
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
protected $description = 'Export account migrations to folder';
|
protected $description = 'Export account migrations to folder.';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new command instance.
|
* Create a new command instance.
|
||||||
@ -43,7 +43,22 @@ class ExportMigrations extends Command
|
|||||||
*/
|
*/
|
||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
foreach (User::all() as $user) {
|
$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);
|
||||||
|
}
|
||||||
|
|
||||||
|
$users = User::all();
|
||||||
|
|
||||||
|
foreach($users as $user) {
|
||||||
|
$this->export($user);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private function export($user)
|
||||||
|
{
|
||||||
$this->account = $user->account;
|
$this->account = $user->account;
|
||||||
|
|
||||||
$date = date('Y-m-d');
|
$date = date('Y-m-d');
|
||||||
@ -78,4 +93,3 @@ class ExportMigrations extends Command
|
|||||||
$this->info('User with id #' . $user->id . ' exported.');
|
$this->info('User with id #' . $user->id . ' exported.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user