mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Merge pull request #4393 from turbo124/v5-stable
Fixes for regression of migration
This commit is contained in:
commit
fb5a4134c1
@ -1 +1 @@
|
||||
5.0.30
|
||||
5.0.31
|
@ -320,7 +320,8 @@ class MigrationController extends BaseController
|
||||
$migration_file = $request->file($company->company_index)
|
||||
->storeAs(
|
||||
'migrations',
|
||||
$request->file($company->company_index)->getClientOriginalName()
|
||||
$request->file($company->company_index)->getClientOriginalName(),
|
||||
'local'
|
||||
);
|
||||
|
||||
if (app()->environment() == 'testing') {
|
||||
@ -328,7 +329,9 @@ class MigrationController extends BaseController
|
||||
}
|
||||
|
||||
try {
|
||||
StartMigration::dispatch(base_path("storage/app/public/$migration_file"), $user, $fresh_company)->delay(now()->addSeconds(5));
|
||||
// StartMigration::dispatch(base_path("storage/app/public/$migration_file"), $user, $fresh_company)->delay(now()->addSeconds(5));
|
||||
info($migration_file);
|
||||
StartMigration::dispatch($migration_file, $user, $fresh_company);
|
||||
} catch (\Exception $e) {
|
||||
info($e->getMessage());
|
||||
}
|
||||
|
@ -85,8 +85,7 @@ class StartMigration implements ShouldQueue
|
||||
$this->company->save();
|
||||
|
||||
$zip = new ZipArchive();
|
||||
$archive = $zip->open($this->filepath);
|
||||
|
||||
$archive = $zip->open(storage_path("app/{$this->filepath}"));
|
||||
$filename = pathinfo($this->filepath, PATHINFO_FILENAME);
|
||||
|
||||
try {
|
||||
@ -94,14 +93,14 @@ class StartMigration implements ShouldQueue
|
||||
throw new ProcessingMigrationArchiveFailed('Processing migration archive failed. Migration file is possibly corrupted.');
|
||||
}
|
||||
|
||||
$zip->extractTo(storage_path("migrations/{$filename}"));
|
||||
$zip->extractTo(storage_path("app/migrations/{$filename}"));
|
||||
$zip->close();
|
||||
|
||||
if (app()->environment() == 'testing') {
|
||||
return true;
|
||||
}
|
||||
|
||||
$file = storage_path("migrations/$filename/migration.json");
|
||||
$file = storage_path("app/migrations/$filename/migration.json");
|
||||
|
||||
if (! file_exists($file)) {
|
||||
throw new NonExistingMigrationFile('Migration file does not exist, or it is corrupted.');
|
||||
|
@ -128,13 +128,14 @@ trait AppSetup
|
||||
}
|
||||
}
|
||||
|
||||
// This should never happen, but this is login just in case.
|
||||
// Variables that will be replaced (updated with different content) should already be in .env file.
|
||||
$words_count = count(explode(' ', trim($value)));
|
||||
|
||||
if (is_null($position)) {
|
||||
$env[] = "{$property}=" . $value . "\n";
|
||||
$words_count > 1 ? $env[] = "{$property}=" . '"' . $value . '"' . "\n" : $env[] = "{$property}=" . $value . "\n";
|
||||
} else if ($words_count > 1) {
|
||||
$env[$position] = "{$property}=" . '"' . $value . '"' . "\n"; // If value of variable is more than one word, surround with quotes.
|
||||
} else {
|
||||
$env[$position] = "{$property}=" . $value . "\n";
|
||||
$env[$position] = "{$property}=" . $value . "\n"; // Just a normal variable update, with prexisting keys.
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -12,7 +12,7 @@ return [
|
||||
'require_https' => env('REQUIRE_HTTPS', true),
|
||||
'app_url' => rtrim(env('APP_URL', ''), '/').'/',
|
||||
'app_domain' => env('APP_DOMAIN', ''),
|
||||
'app_version' => '5.0.30',
|
||||
'app_version' => '5.0.31',
|
||||
'minimum_client_version' => '5.0.16',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', false),
|
||||
|
Loading…
x
Reference in New Issue
Block a user