Skip to content

Commit

Permalink
Merge pull request #4097 from jonasraoni/bugfix/main/9475-recover-lay…
Browse files Browse the repository at this point in the history
…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
jonasraoni authored Jan 17, 2024
2 parents fff7899 + 6b26f00 commit cefbee7
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
43 changes: 43 additions & 0 deletions classes/migration/upgrade/v3_5_0/I9475_RecoverLayoutFiles.php
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();
}
}
1 change: 1 addition & 0 deletions dbscripts/xml/upgrade.xml
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,7 @@
<upgrade minversion="3.4.0.0" maxversion="3.4.9.9">
<migration class="PKP\migration\upgrade\v3_5_0\I9197_MigrateAccessKeys"/>
<migration class="PKP\migration\upgrade\v3_5_0\I9262_Highlights"/>
<migration class="APP\migration\upgrade\v3_5_0\I9475_RecoverLayoutFiles"/>
</upgrade>

<upgrade minversion="3.1.0.0" maxversion="3.4.9.9">
Expand Down

0 comments on commit cefbee7

Please sign in to comment.