-
Notifications
You must be signed in to change notification settings - Fork 922
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4097 from jonasraoni/bugfix/main/9475-recover-lay…
…out-files pkp/pkp-lib#9475 Move layout files (OJS 2.x) from the stage SUBMISSION_FILE_PROOF to SUBMISSION_FILE_PRODUCTION_READY
- Loading branch information
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
43 changes: 43 additions & 0 deletions
43
classes/migration/upgrade/v3_5_0/I9475_RecoverLayoutFiles.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/** | ||
* @file classes/migration/upgrade/v3_5_0/I9475_RecoverLayoutFiles.php | ||
* | ||
* Copyright (c) 2023 Simon Fraser University | ||
* Copyright (c) 2023 John Willinsky | ||
* Distributed under the GNU GPL v3. For full terms see the file docs/COPYING. | ||
* | ||
* @class I9475_RecoverLayoutFiles | ||
* | ||
* @brief Move old layout files (in case the installation has ever been upgraded from an OJS 2.x) from the SUBMISSION_FILE_PROOF stage to the SUBMISSION_FILE_PRODUCTION_READY | ||
*/ | ||
|
||
namespace APP\migration\upgrade\v3_5_0; | ||
|
||
use Illuminate\Support\Facades\DB; | ||
use PKP\install\DowngradeNotSupportedException; | ||
|
||
class I9475_RecoverLayoutFiles extends \PKP\migration\Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
DB::table('submission_files') | ||
// SUBMISSION_FILE_PROOF | ||
->where('file_stage', '=', 10) | ||
->whereNull('assoc_id') | ||
->whereNull('assoc_type') | ||
// SUBMISSION_FILE_PRODUCTION_READY | ||
->update(['file_stage' => 11]); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
throw new DowngradeNotSupportedException(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters