mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
minor fixes for migrations
This commit is contained in:
parent
22e739ca26
commit
9372a304c7
@ -7,6 +7,7 @@ use App\Models\User;
|
|||||||
use App\Traits\GenerateMigrationResources;
|
use App\Traits\GenerateMigrationResources;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
class ExportMigrations extends Command
|
class ExportMigrations extends Command
|
||||||
{
|
{
|
||||||
@ -63,12 +64,12 @@ class ExportMigrations extends Command
|
|||||||
|
|
||||||
|
|
||||||
if($this->option('email')) {
|
if($this->option('email')) {
|
||||||
$record = User::on(DB_NINJA_1)->where('email', $this->option('user'))->first();
|
$record = User::on(DB_NINJA_1)->where('email', $this->option('email'))->first();
|
||||||
|
|
||||||
if($record)
|
if($record)
|
||||||
return $this->export($record);
|
return $this->export($record);
|
||||||
|
|
||||||
$record = User::on(DB_NINJA_2)->where('email', $this->option('user'))->first();
|
$record = User::on(DB_NINJA_2)->where('email', $this->option('email'))->first();
|
||||||
|
|
||||||
if($record)
|
if($record)
|
||||||
return $this->export($record);
|
return $this->export($record);
|
||||||
@ -132,6 +133,7 @@ class ExportMigrations extends Command
|
|||||||
'ninja_tokens' => $this->getNinjaToken(),
|
'ninja_tokens' => $this->getNinjaToken(),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Storage::makeDirectory('migrations');
|
||||||
$file = storage_path("migrations/{$fileName}.zip");
|
$file = storage_path("migrations/{$fileName}.zip");
|
||||||
|
|
||||||
$zip = new \ZipArchive();
|
$zip = new \ZipArchive();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user