mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Merge pull request #4394 from turbo124/v5-stable
Minor changes to migration
This commit is contained in:
commit
792262dee4
@ -321,7 +321,7 @@ class MigrationController extends BaseController
|
||||
->storeAs(
|
||||
'migrations',
|
||||
$request->file($company->company_index)->getClientOriginalName(),
|
||||
'local'
|
||||
'public'
|
||||
);
|
||||
|
||||
if (app()->environment() == 'testing') {
|
||||
|
@ -85,7 +85,7 @@ class StartMigration implements ShouldQueue
|
||||
$this->company->save();
|
||||
|
||||
$zip = new ZipArchive();
|
||||
$archive = $zip->open(storage_path("app/{$this->filepath}"));
|
||||
$archive = $zip->open(public_path("storage/{$this->filepath}"));
|
||||
$filename = pathinfo($this->filepath, PATHINFO_FILENAME);
|
||||
|
||||
try {
|
||||
@ -93,14 +93,14 @@ class StartMigration implements ShouldQueue
|
||||
throw new ProcessingMigrationArchiveFailed('Processing migration archive failed. Migration file is possibly corrupted.');
|
||||
}
|
||||
|
||||
$zip->extractTo(storage_path("app/migrations/{$filename}"));
|
||||
$zip->extractTo(public_path("storage/migrations/{$filename}"));
|
||||
$zip->close();
|
||||
|
||||
if (app()->environment() == 'testing') {
|
||||
return true;
|
||||
}
|
||||
|
||||
$file = storage_path("app/migrations/$filename/migration.json");
|
||||
$file = public_path("storage/migrations/$filename/migration.json");
|
||||
|
||||
if (! file_exists($file)) {
|
||||
throw new NonExistingMigrationFile('Migration file does not exist, or it is corrupted.');
|
||||
|
Loading…
x
Reference in New Issue
Block a user